//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#include <kxmips.h>

    .set noat
    .set noreorder

    BSS(_fsr, 4)

/*used       "la          AT,_fsr     "
  replace    "lui         AT,0x4019   "
             "addiu       AT,AT,0xFC8C"

  used       "AT"
  replace    "at"
*/

#ifdef _NOFLOAT

LEAF(__dptofp)
    .set        noat
    addiu       sp,sp,0xFFD8
    sw          ra,0x20(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x18(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,8(sp)
    sw          a1,0xC(sp)
    sll         t0,a1,1
    srl         t0,t0,0x15
    sll         a3,a1,0xB
    srl         t3,a0,0x15
    or          a3,a3,t3
    sll         a2,a0,0xB
    lui         t1,0x8000
    or          a3,a3,t1
    and         t1,t1,a1
    addiu       t0,t0,0xFC80
    addiu       t3,t0,0xFFFF
    sltiu       AT,t3,0xFE
    beq         zero,AT,dptofp001
    nop
dptofp020:
    la          AT,_fsr
    lw          t2,0(AT)
    andi        t9,a3,0xFF
    or          t9,t9,a2
    bne         zero,t9,dptofp002
    nop
    andi        t9,t2,0x100
    beq         zero,t9,dptofp003
    nop
    b           dptofp004
    nop
dptofp002:
    ori         t2,t2,0x1004
    la          AT,_fsr
    lw          t9,0(AT)
    andi        t9,t9,3
    beq         zero,t9,dptofp005
    nop
    ori         AT,zero,2
    beq         AT,t9,dptofp006
    nop
    ori         AT,zero,3
    beq         AT,t9,dptofp007
    nop
    b           dptofp004
    nop
dptofp006:
    beq         zero,t1,dptofp008
    nop
    b           dptofp004
    nop
dptofp007:
    beq         zero,t1,dptofp004
    nop
dptofp008:
    addiu       a3,a3,0x100
    sltiu       t9,a3,0x100
    addu        t0,t0,t9
    b           dptofp004
    nop
dptofp005:
    andi        t9,a3,0x17F
    or          t9,t9,a2
    beq         zero,t9,dptofp004
    nop
    addiu       a3,a3,0x80
    sltiu       t9,a3,0x80
    addu        t0,t0,t9
dptofp004:
    bgtz        t0,dptofp003
    nop
    ori         t2,t2,0x2008
dptofp003:
    sltiu       AT,t0,0xFF
    bne         zero,AT,dptofp009
    nop
    ori         t2,t2,0x5014
    addi        t0,t0,0xFF40
    andi        t9,t2,0x200
    beq         zero,t9,dptofp010
    nop
    sltiu       AT,t0,0xFF
    bne         zero,AT,dptofp009
    nop
dptofp010:
    la          AT,_fsr
    lw          t9,0(AT)
    andi        t9,t9,3
    ori         AT,zero,1
    beq         AT,t9,dptofp011
    nop
    beq         zero,t9,dptofp012
    nop
    beq         zero,t1,dptofp013
    nop
    ori         AT,zero,3
    beq         AT,t9,dptofp012
    nop
    ori         AT,zero,2
    beq         AT,t9,dptofp011
    nop
    b           dptofp009
    nop
dptofp013:
    ori         AT,zero,3
    beq         AT,t9,dptofp011
    nop
    ori         AT,zero,2
    beq         AT,t9,dptofp012
    nop
    b           dptofp009
    nop
dptofp012:
    ori         t0,zero,0xFF
    ori         a3,zero,0
    b           dptofp009
    nop
dptofp011:
    ori         t0,zero,0xFE
    lui         a3,0x7FFF
    ori         a3,a3,0xFF00
dptofp009:
    la          AT,_fsr
    sw          t2,0(AT)
    sll         a3,a3,1
    srl         a3,a3,9
    sll         t3,t0,0x17
    or          a3,a3,t3
dptofp019:
    or          a0,a3,t1
dptofp018:
    la          AT,_fsr
    lw          t9,0(AT)
    srl         t8,t9,5
    and         t8,t8,t9
    andi        t8,t8,0xF80
    or          v1,a1,zero
    or          v0,a0,zero
    beq         zero,t8,dptofp014
    nop
    lw          a2,8(sp)
    lw          a3,0xC(sp)
    sw          a0,0x10(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,8
    jal         _exceptfd
    nop
    lw          v0,0x10(sp)
    lw          ra,0x20(sp)
dptofp014:
    addiu       sp,sp,0x28
    jr          ra
    nop
dptofp001:
    ori         AT,zero,0x47F
    bne         AT,t0,dptofp015
    nop
    sll         a3,a3,1
    srl         a3,a3,1
    or          t3,a3,a2
    beq         zero,t3,dptofp016
    nop
    srl         t3,a3,0x1E
    beq         zero,t3,dptofp017
    nop
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
dptofp017:
    lui         a0,0x7F80
    ori         a0,a0,1
    b           dptofp018
    nop
dptofp016:
    lui         a3,0x7F80
    b           dptofp019
    nop
dptofp015:
    slti        AT,t0,0xFF
    beq         zero,AT,dptofp020
    nop
    addiu       AT,zero,0xFC80
    bne         AT,t0,dptofp021
    nop
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,0x100
    and         t9,t9,AT
    beq         zero,t9,dptofp022
    nop
    ori         a3,zero,0
    ori         a2,zero,0
dptofp022:
    sll         a3,a3,1
    srl         a3,a3,1
dptofp021:
    or          t3,a3,a2
    beq         zero,t3,dptofp019
    nop
    la          AT,_fsr
    lw          t2,0(AT)
    andi        t3,t2,0x100
    beq         zero,t3,dptofp023
    nop
    addiu       t0,t0,0xC0
    la          AT,_fsr
    lw          t9,0(AT)
    ori         t9,t9,0x2008
    la          AT,_fsr
    sw          t9,0(AT)
    bgtz        t0,dptofp020
    nop
dptofp023:
    ori         t2,zero,1
    subu        t2,t2,t0
    sltiu       AT,t2,0x20
    bne         zero,AT,dptofp024
    nop
    or          a2,a2,a3
    ori         a3,zero,0
    b           dptofp025
    nop
dptofp024:
    ori         t4,zero,0x20
    subu        t4,t4,t2
    sllv        t3,a3,t4
    or          a2,a2,t3
    srlv        a3,a3,t2
dptofp025:
    ori         t0,zero,0
    lui         AT,0x8000
    or          a3,a3,AT
    b           dptofp020
    nop
    .set        at
END(__dptofp)

LEAF(_getNOCp)
    .set        noat
    la          AT,_fsr
    lw          a1,0(AT)
    srl         a1,a1,0xC
    andi        a1,a1,0x1F
    lui         a0,0x4010
    addiu       a0,a0,0x1E94
    addu        a0,a0,a1
    lb          a0,0(a0)
    jr          ra
    nop
    .set        at
END(_getNOCp)

LEAF(_exceptfd)
    addiu       sp,sp,0xFFC8
    sw          ra,0x30(sp)
    sw          s8,0x20(sp)
    sw          s7,0x24(sp)
    sw          s6,0x28(sp)
    sw          s5,0x2C(sp)
    or          s5,a0,zero
    lw          a0,0x48(sp)
    or          s8,a3,zero
    or          s7,a2,zero
    jal         __fptodp
    or          s6,a1,zero
    lw          a3,0x4C(sp)
    or          a2,s7,zero
    sw          a3,0x18(sp)
    or          a3,s8,zero
    or          a1,s6,zero
    or          a0,s5,zero
    sw          v1,0x14(sp)
    jal         _except1
    sw          v0,0x10(sp)
    or          a1,zero,zero
    or          a0,zero,zero
    or          s6,v1,zero
    jal         _controlfp
    or          s7,v0,zero
    lui         s8,8
    ori         s8,s8,0x1F
    or          a1,s8,zero
    or          a0,s8,zero
    jal         _controlfp
    or          s5,v0,zero
    or          a1,s8,zero
    jal         _controlfp
    or          a0,s5,zero
    or          a1,s6,zero
    jal         __dptofp
    or          a0,s7,zero
    lw          s8,0x20(sp)
    lw          s7,0x24(sp)
    lw          s6,0x28(sp)
    lw          s5,0x2C(sp)
    lw          ra,0x30(sp)
    jr          ra
    addiu       sp,sp,0x38
END(_exceptfd)

LEAF(_controlfp)
    addiu       sp,sp,0xFFE0
    sw          ra,0x1C(sp)
    sw          s8,0x10(sp)
    sw          s7,0x14(sp)
    sw          s6,0x18(sp)
    or          s7,a1,zero
    jal         _get_fsr
    or          s6,a0,zero
    or          s8,v0,zero
    jal         controlfp001
    or          a0,s8,zero
    nor         v1,s7,zero
    and         v0,v0,v1
    and         v1,s6,s7
    or          s7,v0,v1
    jal         controlfp002
    or          a0,s7,zero
    lui         v1,0x100
    xor         v0,v0,s8
    ori         v1,v1,0xF83
    and         v0,v0,v1
    jal         _set_fsr
    xor         a0,v0,s8
    or          v0,s7,zero
    lw          s8,0x10(sp)
    lw          s7,0x14(sp)
    lw          s6,0x18(sp)
    lw          ra,0x1C(sp)
    jr          ra
    addiu       sp,sp,0x20
controlfp001:
    andi        v1,a0,0x800
    bne         zero,v1,controlfp003
    or          v0,zero,zero
    addiu       v0,zero,0x10
controlfp003:
    andi        v1,a0,0x400
    bnel        zero,v1,controlfp004
    andi        v1,a0,0x200
    ori         v0,v0,8
    andi        v1,a0,0x200
controlfp004:
    bnel        zero,v1,controlfp005
    andi        v1,a0,0x100
    ori         v0,v0,4
    andi        v1,a0,0x100
controlfp005:
    bnel        zero,v1,controlfp006
    andi        v1,a0,0x80
    ori         v0,v0,2
    andi        v1,a0,0x80
controlfp006:
    bnel        zero,v1,controlfp007
    andi        v1,a0,3
    ori         v0,v0,1
    andi        v1,a0,3
controlfp007:
    beq         zero,v1,controlfp008
    nop
    addiu       a3,zero,1
    beql        a3,v1,controlfp008
    ori         v0,v0,0x300
    addiu       a3,zero,2
    beq         a3,v1,controlfp009
    nop
    addiu       a3,zero,3
    bne         a3,v1,controlfp008
    nop
    b           controlfp008
    ori         v0,v0,0x100
controlfp009:
    b           controlfp008
    ori         v0,v0,0x200
controlfp008:
    lui         v1,0x100
    and         a3,a0,v1
    beq         zero,a3,controlfp010
    nop
    or          v0,v0,v1
controlfp010:
    jr          ra
    nop
controlfp002:
    andi        v1,a0,0x10
    bne         zero,v1,controlfp011
    or          v0,zero,zero
    addiu       v0,zero,0x800
controlfp011:
    andi        v1,a0,8
    bnel        zero,v1,controlfp012
    andi        v1,a0,4
    ori         v0,v0,0x400
    andi        v1,a0,4
controlfp012:
    bnel        zero,v1,controlfp013
    andi        v1,a0,2
    ori         v0,v0,0x200
    andi        v1,a0,2
controlfp013:
    bnel        zero,v1,controlfp014
    andi        v1,a0,1
    ori         v0,v0,0x100
    andi        v1,a0,1
controlfp014:
    bnel        zero,v1,controlfp015
    andi        v1,a0,0x300
    ori         v0,v0,0x80
    andi        v1,a0,0x300
controlfp015:
    beq         zero,v1,controlfp016
    nop
    addiu       a3,zero,0x100
    beql        a3,v1,controlfp016
    ori         v0,v0,3
    addiu       a3,zero,0x200
    beq         a3,v1,controlfp017
    nop
    addiu       a3,zero,0x300
    bne         a3,v1,controlfp016
    nop
    b           controlfp016
    ori         v0,v0,1
controlfp017:
    b           controlfp016
    ori         v0,v0,2
controlfp016:
    lui         v1,0x100
    and         a3,a0,v1
    bne         v1,a3,controlfp018
    nop
    or          v0,v0,v1
controlfp018:
    jr          ra
    nop
END(_controlfp)

LEAF(_get_fsr)
    .set        noat
    la          AT,_fsr
    lw          v0,0(AT)
    jr          ra
    nop
    .set        at
END(_get_fsr)

LEAF(_set_fsr)
    .set        noat
    la          AT,_fsr
    sw          a0,0(AT)
    jr          ra
    nop
    .set        at
END(_set_fsr)

LEAF(__fptodp)
    .set        noat
    addiu       sp,sp,0xFFD8
    sw          ra,0x20(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x18(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    srl         a3,a0,0x17
    andi        a3,a3,0xFF
    lui         t0,0x8000
    and         a2,a0,t0
    addiu       t2,a3,0xFFFF
    sltiu       AT,t2,0xFE
    beq         zero,AT,fptodp001
    nop
fptodp007:
    addiu       a3,a3,0x380
fptodp008:
    sll         t2,a0,9
    srl         t2,t2,0xC
    or          a2,a2,t2
    sll         a1,a0,0x1D
    sll         t2,a3,0x14
    or          a2,a2,t2
fptodp004:
    la          AT,_fsr
    lw          t9,0(AT)
    srl         t8,t9,5
    and         t8,t8,t9
    andi        t8,t8,0xF80
    or          v1,a2,zero
    or          v0,a1,zero
    beq         zero,t8,fptodp002
    nop
    or          a3,a2,zero
    or          a2,a1,zero
    sw          a2,0x10(sp)
    sw          a3,0x14(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,8
    jal         _exceptdd
    nop
    lw          ra,0x20(sp)
fptodp002:
    addiu       sp,sp,0x28
    jr          ra
    nop
fptodp001:
    ori         a1,zero,0
    bne         zero,a3,fptodp003
    nop
    addu        a0,a0,a0
    beq         zero,a0,fptodp004
    nop
fptodp006:
    blez        a0,fptodp005
    nop
    addu        a0,a0,a0
    addiu       a3,a3,0xFFFF
    b           fptodp006
    nop
fptodp005:
    srl         a0,a0,8
    addiu       a3,a3,8
    b           fptodp007
    nop
fptodp003:
    ori         a3,zero,0x7FF
    lui         AT,0x7F
    ori         AT,AT,0xFFFF
    and         t2,a0,AT
    beq         zero,t2,fptodp008
    nop
    lui         AT,0x40
    and         t2,a0,AT
    beq         zero,t2,fptodp009
    nop
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
fptodp009:
    lui         a2,0x7FF0
    ori         a1,zero,1
    b           fptodp004
    nop
    .set        at
END(__fptodp)

LEAF(_exceptdd)
    addiu       sp,sp,0xFFD8
    sw          ra,0x20(sp)
    lw          v0,0x40(sp)
    sw          v0,0x18(sp)
    lw          v0,0x3C(sp)
    sw          v0,0x14(sp)
    lw          v0,0x38(sp)
    jal         _except1
    sw          v0,0x10(sp)
    lw          ra,0x20(sp)
    jr          ra
    addiu       sp,sp,0x28
END(_exceptdd)

LEAF(_except1)
    addiu       sp,sp,0xFF80
    sw          ra,0x78(sp)
    sw          s8,0x70(sp)
    sw          s7,0x74(sp)
    sw          a2,0x88(sp)
    or          s8,a0,zero
    or          s7,a1,zero
    lw          a2,0x98(sp)
    addiu       a1,sp,0x90
    or          a0,s8,zero
    jal         _handle_exc
    sw          a3,0x8C(sp)
    bne         zero,v0,except101
    nop
    lui         v1,0xFFFF
    lw          v0,0x50(sp)
    ori         v1,v1,0xFFFE
    and         v0,v0,v1
    sw          v0,0x50(sp)
    addiu       v0,sp,0x90
    sw          v0,0x14(sp)
    addiu       v0,sp,0x88
    or          a3,s7,zero
    or          a2,s8,zero
    addiu       a1,sp,0x98
    addiu       a0,sp,0x18
    jal         _raise_exc
    sw          v0,0x10(sp)
except101:  lui         a1,0xFFFF
    lw          a0,0x98(sp)
    jal         _ctrlfp
    ori         a1,a1,0xFF83
    lw          v0,0x90(sp)
    lw          v1,0x94(sp)
    lw          s8,0x70(sp)
    lw          s7,0x74(sp)
    lw          ra,0x78(sp)
    jr          ra
    addiu       sp,sp,0x80
END(_except1)

LEAF(_handle_exc)
    addiu       sp,sp,0xFFB8
    sw          ra,0x40(sp)
    sw          s8,0x20(sp)
    sw          s7,0x24(sp)
    sw          s6,0x28(sp)
    sw          s5,0x2C(sp)
    sw          s4,0x30(sp)
    sw          s3,0x34(sp)
    sw          s2,0x38(sp)
    sw          s1,0x3C(sp)
    or          s3,a0,zero
    or          s1,a2,zero
    or          s5,a1,zero
    andi        s2,s3,0x1F
    andi        v0,s3,8
    beq         zero,v0,handle_exc001
    addiu       s4,zero,1
    andi        v0,s1,0x800
    beql        zero,v0,handle_exc002
    andi        v0,s3,4
    jal         _set_stATfp
    addiu       a0,zero,0x40
    addiu       v0,zero,0xFFF7
    b           handle_exc003
    and         s2,s2,v0
handle_exc001:
    andi        v0,s3,4
handle_exc002:
    beql        zero,v0,handle_exc004
    andi        v0,s3,1
    andi        v0,s1,0x400
    beql        zero,v0,handle_exc004
    andi        v0,s3,1
    jal         _set_stATfp
    addiu       a0,zero,0x20
    addiu       v0,zero,0xFFFB
    b           handle_exc003
    and         s2,s2,v0
handle_exc004:
    beql        zero,v0,handle_exc005
    andi        v0,s3,2
    andi        v0,s1,0x200
    beql        zero,v0,handle_exc005
    andi        v0,s3,2
    jal         _set_stATfp
    addiu       a0,zero,0x10
    andi        v0,s1,3
    beq         zero,v0,handle_exc006
    nop
    beq         s4,v0,handle_exc007
    nop
    addiu       v1,zero,2
    beq         v1,v0,handle_exc008
    nop
    addiu       v1,zero,3
    bnel        v1,v0,handle_exc009
    addiu       v0,zero,0xFFFE
    lw          a1,4(s5)
    lw          a0,0(s5)
    or          a3,zero,zero
    jal         __gtd
    or          a2,zero,zero
    beq         zero,v0,handle_exc010
    nop
    lui         v0,0x4010
    addiu       v0,v0,0x1EC8
    lw          v1,0(v0)
    b           handle_exc011
    lw          v0,4(v0)
handle_exc010:
    lui         v0,0x4010
    addiu       v0,v0,0x1EB8
    lw          v1,0(v0)
    lw          v0,4(v0)
    lui         a3,0x8000
    xor         v0,v0,a3
handle_exc011:
    sw          v1,0(s5)
    b           handle_exc012
    sw          v0,4(s5)
handle_exc008:
    lw          a1,4(s5)
    lw          a0,0(s5)
    or          a3,zero,zero
    jal         __gtd
    or          a2,zero,zero
    beq         zero,v0,handle_exc013
    nop
    lui         v0,0x4010
    addiu       v0,v0,0x1EB8
    lw          v1,0(v0)
    b           handle_exc014
    lw          v0,4(v0)
handle_exc013:
    lui         v0,0x4010
    addiu       v0,v0,0x1EC8
    lw          v1,0(v0)
    lw          v0,4(v0)
    lui         a3,0x8000
    xor         v0,v0,a3
handle_exc014:
    sw          v1,0(s5)
    b           handle_exc012
    sw          v0,4(s5)
handle_exc007:
    lw          a1,4(s5)
    lw          a0,0(s5)
    or          a3,zero,zero
    jal         __gtd
    or          a2,zero,zero
    beq         zero,v0,handle_exc015
    nop
    lui         v0,0x4010
    addiu       v0,v0,0x1EC8
    lw          v1,0(v0)
    b           handle_exc016
    lw          v0,4(v0)
handle_exc015:
    lui         v0,0x4010
    addiu       v0,v0,0x1EC8
    lw          v1,0(v0)
    lw          v0,4(v0)
    lui         a3,0x8000
    xor         v0,v0,a3
handle_exc016:
    sw          v1,0(s5)
    b           handle_exc012
    sw          v0,4(s5)
handle_exc006:
    lw          a1,4(s5)
    lw          a0,0(s5)
    or          a3,zero,zero
    jal         __gtd
    or          a2,zero,zero
    beq         zero,v0,handle_exc017
    nop
    lui         v0,0x4010
    addiu       v0,v0,0x1EB8
    lw          v1,0(v0)
    b           handle_exc018
    lw          v0,4(v0)
handle_exc017:
    lui         v0,0x4010
    addiu       v0,v0,0x1EB8
    lw          v1,0(v0)
    lw          v0,4(v0)
    lui         a3,0x8000
    xor         v0,v0,a3
handle_exc018:
    sw          v1,0(s5)
    sw          v0,4(s5)
handle_exc012:
    addiu       v0,zero,0xFFFE
handle_exc009:
    b           handle_exc003
    and         s2,s2,v0
handle_exc005:
    beql        zero,v0,handle_exc019
    andi        v0,s3,0x10
    andi        v0,s1,0x100
    beql        zero,v0,handle_exc019
    andi        v0,s3,0x10
    andi        v0,s3,0x10
    beq         zero,v0,handle_exc020
    or          s6,zero,zero
    or          s6,s4,zero
handle_exc020:
    lw          s8,0(s5)
    lw          s7,4(s5)
    or          a3,zero,zero
    or          a2,zero,zero
    or          a1,s7,zero
    jal         __ned
    or          a0,s8,zero
    beql        zero,v0,handle_exc021
    or          s6,s4,zero
    addiu       a2,sp,0x10
    or          a1,s7,zero
    jal         _decomp
    or          a0,s8,zero
    or          s8,v0,zero
    lw          v0,0x10(sp)
    or          a1,v1,zero
    addiu       s7,v0,0xFA00
    slti        v0,s7,0xFBCE
    beq         zero,v0,handle_exc022
    sw          a1,0x1C(sp)
    or          a3,zero,zero
    or          a2,zero,zero
    jal         __dpmul
    or          a0,s8,zero
    or          s8,v0,zero
    b           handle_exc023
    or          s6,s4,zero
handle_exc022:
    or          a3,zero,zero
    or          a2,zero,zero
    jal         __ltd
    or          a0,s8,zero
    beql        zero,v0,handle_exc024
    or          a2,zero,zero
    b           handle_exc024
    or          a2,s4,zero
handle_exc024:
    lhu         v0,0x1E(sp)
    andi        v0,v0,0xFFFF
    andi        v0,v0,0xF
    ori         v0,v0,0x10
    sh          v0,0x1E(sp)
    slti        v0,s7,0xFC03
    beq         zero,v0,handle_exc025
    lui         a3,0x8000
    lui         v0,0xFFFF
    lw          v1,0x1C(sp)
    ori         v0,v0,0xFC03
    subu        v0,v0,s7
handle_exc028:
    andi        a1,s8,1
    beql        zero,a1,handle_exc026
    andi        a1,v1,1
    bnel        zero,s6,handle_exc026
    andi        a1,v1,1
    or          s6,s4,zero
    andi        a1,v1,1
handle_exc026:
    beq         zero,a1,handle_exc027
    srl         s8,s8,1
    or          s8,s8,a3
handle_exc027:
    addiu       v0,v0,0xFFFF
    bne         zero,v0,handle_exc028
    srl         v1,v1,1
    b           handle_exc029
    nop
handle_exc025:
    lw          v1,0x1C(sp)
handle_exc029:
    beq         zero,a2,handle_exc023
    nop
    xor         v1,v1,a3
handle_exc023:
    sw          s8,0(s5)
    b           handle_exc021
    sw          v1,4(s5)
handle_exc021:
    beql        zero,s6,handle_exc030
    addiu       v0,zero,0xFFFD
    jal         _set_stATfp
    addiu       a0,zero,8
    addiu       v0,zero,0xFFFD
handle_exc030:
    and         s2,s2,v0
handle_exc003:
    andi        v0,s3,0x10
handle_exc019:
    beq         zero,v0,handle_exc031
    nop
    andi        v0,s1,0x80
    beq         zero,v0,handle_exc031
    nop
    jal         _set_stATfp
    addiu       a0,zero,4
    addiu       v0,zero,0xFFEF
    and         s2,s2,v0
handle_exc031:
    beql        zero,s2,handle_exc032
    or          v0,s4,zero
    b           handle_exc032
    or          v0,zero,zero
handle_exc032:
    lw          s8,0x20(sp)
    lw          s7,0x24(sp)
    lw          s6,0x28(sp)
    lw          s5,0x2C(sp)
    lw          s4,0x30(sp)
    lw          s3,0x34(sp)
    lw          s2,0x38(sp)
    lw          s1,0x3C(sp)
    lw          ra,0x40(sp)
    jr          ra
    addiu       sp,sp,0x48
END(_handle_exc)

LEAF(_raise_exc)
    addiu       sp,sp,0xFFC0
    sw          ra,0x3C(sp)
    sw          s8,0x18(sp)
    sw          s7,0x1C(sp)
    sw          s6,0x20(sp)
    sw          s5,0x24(sp)
    sw          s4,0x28(sp)
    sw          s3,0x2C(sp)
    sw          s2,0x30(sp)
    sw          s1,0x34(sp)
    sw          s0,0x38(sp)
    sw          a0,0x40(sp)
    sw          zero,4(a0)
    lw          v0,0x40(sp)
    or          s8,a3,zero
    sw          zero,8(v0)
    lw          v0,0x40(sp)
    sw          zero,0xC(v0)
    andi        v0,a2,0x10
    beq         zero,v0,raise_exc001
    or          s6,a1,zero
    lw          v0,0x40(sp)
    lw          v1,4(v0)
    lui         s0,0xC000
    ori         v1,v1,1
    ori         s0,s0,0x8F
    b           raise_exc002
    sw          v1,4(v0)
raise_exc001:
    lw          s0,0x10(sp)
raise_exc002:
    andi        v0,a2,2
    beql        zero,v0,raise_exc003
    andi        v0,a2,1
    lw          v0,0x40(sp)
    lw          v1,4(v0)
    lui         s0,0xC000
    ori         v1,v1,2
    ori         s0,s0,0x93
    sw          v1,4(v0)
    andi        v0,a2,1
raise_exc003:
    beql        zero,v0,raise_exc004
    andi        v0,a2,4
    lw          v0,0x40(sp)
    lw          v1,4(v0)
    lui         s0,0xC000
    ori         v1,v1,4
    ori         s0,s0,0x91
    sw          v1,4(v0)
    andi        v0,a2,4
raise_exc004:
    beql        zero,v0,raise_exc005
    andi        v0,a2,8
    lw          v0,0x40(sp)
    lw          v1,4(v0)
    lui         s0,0xC000
    ori         v1,v1,8
    ori         s0,s0,0x8E
    sw          v1,4(v0)
    andi        v0,a2,8
raise_exc005:
    beq         zero,v0,raise_exc006
    nop
    lw          v0,0x40(sp)
    lw          v1,4(v0)
    lui         s0,0xC000
    ori         v1,v1,0x10
    ori         s0,s0,0x90
    sw          v1,4(v0)
raise_exc006:
    lw          v0,0(s6)
    andi        v0,v0,0x800
    beq         zero,v0,raise_exc007
    addiu       s7,zero,1
    b           raise_exc008
    or          v1,zero,zero
raise_exc007:
    or          v1,s7,zero
raise_exc008:
    lw          v0,0x40(sp)
    sll         v1,v1,4
    lw          a3,8(v0)
    xor         v1,v1,a3
    lw          a3,8(v0)
    andi        v1,v1,0x10
    xor         v1,v1,a3
    sw          v1,8(v0)
    lw          v0,0(s6)
    andi        v0,v0,0x400
    beql        zero,v0,raise_exc009
    or          v1,s7,zero
    b           raise_exc009
    or          v1,zero,zero
raise_exc009:
    lw          v0,0x40(sp)
    sll         v1,v1,3
    lw          a3,8(v0)
    xor         v1,v1,a3
    lw          a3,8(v0)
    andi        v1,v1,8
    xor         v1,v1,a3
    sw          v1,8(v0)
    lw          v0,0(s6)
    andi        v0,v0,0x200
    beql        zero,v0,raise_exc010
    or          v1,s7,zero
    b           raise_exc010
    or          v1,zero,zero
raise_exc010:
    lw          v0,0x40(sp)
    sll         v1,v1,2
    lw          a3,8(v0)
    xor         v1,v1,a3
    lw          a3,8(v0)
    andi        v1,v1,4
    xor         v1,v1,a3
    sw          v1,8(v0)
    lw          v0,0(s6)
    andi        v0,v0,0x100
    beql        zero,v0,raise_exc011
    or          v1,s7,zero
    b           raise_exc011
    or          v1,zero,zero
raise_exc011:
    lw          v0,0x40(sp)
    sll         v1,v1,1
    lw          a3,8(v0)
    xor         v1,v1,a3
    lw          a3,8(v0)
    andi        v1,v1,2
    xor         v1,v1,a3
    sw          v1,8(v0)
    lw          v0,0(s6)
    andi        v0,v0,0x80
    beql        zero,v0,raise_exc012
    or          v1,s7,zero
    b           raise_exc012
    or          v1,zero,zero
raise_exc012:
    lw          v0,0x40(sp)
    lw          a3,8(v0)
    xor         v1,a3,v1
    lw          a3,8(v0)
    andi        v1,v1,1
    xor         v1,v1,a3
    jal         _stATfp
    sw          v1,8(v0)
    andi        v1,v0,0x40
    beql        zero,v1,raise_exc013
    andi        v1,v0,0x20
    lw          v1,0x40(sp)
    lw          a3,0xC(v1)
    ori         a3,a3,0x10
    sw          a3,0xC(v1)
    andi        v1,v0,0x20
raise_exc013:
    beql        zero,v1,raise_exc014
    andi        v1,v0,0x10
    lw          v1,0x40(sp)
    lw          a3,0xC(v1)
    ori         a3,a3,8
    sw          a3,0xC(v1)
    andi        v1,v0,0x10
raise_exc014:
    beql        zero,v1,raise_exc015
    andi        v1,v0,8
    lw          v1,0x40(sp)
    lw          a3,0xC(v1)
    ori         a3,a3,4
    sw          a3,0xC(v1)
    andi        v1,v0,8
raise_exc015:
    beql        zero,v1,raise_exc016
    andi        v0,v0,4
    lw          v1,0x40(sp)
    lw          a3,0xC(v1)
    ori         a3,a3,2
    sw          a3,0xC(v1)
    andi        v0,v0,4
raise_exc016:
    beq         zero,v0,raise_exc017
    nop
    lw          v0,0x40(sp)
    lw          v1,0xC(v0)
    ori         v1,v1,1
    sw          v1,0xC(v0)
raise_exc017:
    lw          v0,0(s6)
    andi        v0,v0,3
    addiu       s4,zero,2
    addiu       s2,zero,3
    addiu       s1,zero,0xFFFD
    addiu       s3,zero,0xFFFE
    beq         zero,v0,raise_exc100
    addiu       s5,zero,0xFFFC
    beq         s7,v0,raise_exc018
    nop
    beq         s4,v0,raise_exc019
    nop
    bne         s2,v0,raise_exc020
    nop
    lw          v0,0x40(sp)
    lw          v1,0(v0)
    and         v1,v1,s1
    ori         v1,v1,1
    b           raise_exc020
    sw          v1,0(v0)
raise_exc019:
    lw          v0,0x40(sp)
    lw          v1,0(v0)
    and         v1,v1,s3
    ori         v1,v1,2
    b           raise_exc020
    sw          v1,0(v0)
raise_exc018:
    lw          v0,0x40(sp)
    lw          v1,0(v0)
    ori         v1,v1,3
    b           raise_exc020
    sw          v1,0(v0)
raise_exc100:
    lw          v0,0x40(sp)
    lw          v1,0(v0)
    and         v1,v1,s5
    sw          v1,0(v0)
raise_exc020:
    lw          v0,0x40(sp)
    lw          v1,0(v0)
    lui         a3,0xFFFF
    ori         a3,a3,0xFFE7
    and         v1,v1,a3
    ori         v1,v1,4
    sw          v1,0(v0)
    lw          v0,0x40(sp)
    sll         v1,s8,5
    lw          a3,0(v0)
    lw          s8,0x54(sp)
    xor         v1,v1,a3
    lui         a3,1
    ori         a3,a3,0xFFE0
    and         v1,v1,a3
    lw          a3,0(v0)
    xor         v1,v1,a3
    sw          v1,0(v0)
    lw          v0,0x40(sp)
    addiu       a3,zero,0xFFE3
    lw          v1,0x20(v0)
    ori         v1,v1,1
    sw          v1,0x20(v0)
    lw          v0,0x40(sp)
    lw          v1,0x20(v0)
    and         v1,v1,a3
    ori         v1,v1,2
    sw          v1,0x20(v0)
    lw          v1,0x50(sp)
    lw          a2,0(v1)
    lw          v0,0x40(sp)
    sw          a2,0x10(v0)
    lw          v1,4(v1)
    sw          v1,0x14(v0)
    lw          v0,0x40(sp)
    lw          v1,0x50(v0)
    ori         v1,v1,1
    sw          v1,0x50(v0)
    lw          v0,0x40(sp)
    lw          v1,0x50(v0)
    and         v1,v1,a3
    ori         v1,v1,2
    sw          v1,0x50(v0)
    lw          v1,0(s8)
    lw          v0,0x40(sp)
    sw          v1,0x40(v0)
    lw          v1,4(s8)
    jal         _clrfp
    sw          v1,0x44(v0)
    addiu       a3,sp,0x40
    or          a2,s7,zero
    or          a1,zero,zero
    addiu       v0,zero,0xFA3A
    jalr        ra,v0
    or          a0,s0,zero
    lw          v1,0x40(sp)
    lw          v0,8(v1)
    andi        v0,v0,0x10
    beq         zero,v0,raise_exc021
    nop
    lui         a3,0xFFFF
    lw          v0,0(s6)
    ori         a3,a3,0xF7FF
    and         v0,v0,a3
    sw          v0,0(s6)
raise_exc021:
    lw          v0,8(v1)
    andi        v0,v0,8
    beq         zero,v0,raise_exc022
    nop
    lui         a3,0xFFFF
    lw          v0,0(s6)
    ori         a3,a3,0xFBFF
    and         v0,v0,a3
    sw          v0,0(s6)
raise_exc022:
    lw          v0,8(v1)
    andi        v0,v0,4
    beq         zero,v0,raise_exc023
    nop
    lui         a3,0xFFFF
    lw          v0,0(s6)
    ori         a3,a3,0xFDFF
    and         v0,v0,a3
    sw          v0,0(s6)
raise_exc023:
    lw          v0,8(v1)
    andi        v0,v0,2
    beq         zero,v0,raise_exc024
    nop
    lui         a3,0xFFFF
    lw          v0,0(s6)
    ori         a3,a3,0xFEFF
    and         v0,v0,a3
    sw          v0,0(s6)
raise_exc024:
    lw          v0,8(v1)
    andi        v0,v0,1
    beq         zero,v0,raise_exc025
    nop
    lui         a3,0xFFFF
    lw          v0,0(s6)
    ori         a3,a3,0xFF7F
    and         v0,v0,a3
    sw          v0,0(s6)
raise_exc025:
    lw          v0,0(v1)
    andi        v0,v0,3
    beq         zero,v0,raise_exc026
    nop
    beq         s7,v0,raise_exc027
    nop
    beq         s4,v0,raise_exc028
    nop
    bne         s2,v0,raise_exc029
    nop
    lw          v0,0(s6)
    and         v0,v0,s1
    ori         v0,v0,1
    b           raise_exc029
    sw          v0,0(s6)
raise_exc028:
    lw          v0,0(s6)
    and         v0,v0,s3
    ori         v0,v0,2
    b           raise_exc029
    sw          v0,0(s6)
raise_exc027:
    lw          v0,0(s6)
    ori         v0,v0,3
    b           raise_exc029
    sw          v0,0(s6)
raise_exc026:
    lw          v0,0(s6)
    and         v0,v0,s5
    sw          v0,0(s6)
raise_exc029:
    lw          v0,0x40(v1)
    sw          v0,0(s8)
    lw          v0,0x44(v1)
    sw          v0,4(s8)
    lw          s8,0x18(sp)
    lw          s7,0x1C(sp)
    lw          s6,0x20(sp)
    lw          s5,0x24(sp)
    lw          s4,0x28(sp)
    lw          s3,0x2C(sp)
    lw          s2,0x30(sp)
    lw          s1,0x34(sp)
    lw          s0,0x38(sp)
    lw          ra,0x3C(sp)
    jr          ra
    addiu       sp,sp,0x40
END(_raise_exc)

LEAF(_ctrlfp)
    .set        noat
    la          AT,_fsr
    lw          v0,0(AT)
    and         t0,a0,a1
    xori        v0,v0,0xF80
    nor         t1,a1,a1
    and         t1,t1,v0
    or          t2,t0,t1
    xori        t2,t2,0xF80
    la          AT,_fsr
    sw          t2,0(AT)
    jr          ra
    nop
    .set        at
END(_ctrlfp)

LEAF(_set_stATfp)
    .set        noat
    la          AT,_fsr
    lw          v0,0(AT)
    or          v0,v0,a0
    la          AT,_fsr
    sw          v0,0(AT)
    jr          ra
    nop
    .set        at
END(_set_stATfp)

LEAF(__gtd)
    .set        noat
    addiu       sp,sp,0xFFD8
    sw          ra,0x20(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x24(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,0x28(sp)
    sw          a1,0x2C(sp)
    sw          a2,0x30(sp)
    sw          a3,0x34(sp)
    sll         t2,a1,1
    sll         t3,a3,1
    or          t3,t3,a0
    or          t3,t3,a2
    or          t2,t2,t3
    beq         zero,t2,gtd001
    nop
    sll         t0,a1,1
    beq         zero,a0,gtd002
    nop
    ori         t0,t0,1
gtd002:
    sll         t1,a3,1
    beq         zero,a2,gtd003
    nop
    ori         t1,t1,1
gtd003:
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t0,AT
    beq         zero,AT,gtd004
    nop
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t1,AT
    beq         zero,AT,gtd004
    nop
    bgez        a1,gtd005
    nop
    bgez        a3,gtd006
    nop
    sltu        t2,a0,a2
    subu        a0,a0,a2
    subu        a1,a1,t2
    addiu       AT,zero,0xFFFF
    beq         AT,a1,gtd007
    nop
    sltu        t2,a1,a3
gtd007:
    subu        a1,a1,a3
    bne         zero,t2,gtd008
    nop
    or          t2,a1,a0
    bne         zero,t2,gtd006
    nop
    b           gtd001
    nop
gtd005:
    bltz        a3,gtd008
    nop
    sltu        t2,a0,a2
    subu        a0,a0,a2
    subu        a1,a1,t2
    addiu       AT,zero,0xFFFF
    beq         AT,a1,gtd009
    nop
    sltu        t2,a1,a3
gtd009:
    subu        a1,a1,a3
    beq         zero,t2,gtd010
    nop
gtd006:
    ori         v0,zero,0
    b           gtd011
    nop
gtd010:
    or          t2,a1,a0
    beq         zero,t2,gtd001
    nop
gtd008:
    ori         v0,zero,1
    b           gtd011
    nop
gtd001:
    ori         v0,zero,0
gtd011:
    addiu       sp,sp,0x28
    jr          ra
    nop
gtd004:
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    ori         a0,zero,0
    lw          a2,0x28(sp)
    lw          a3,0x2C(sp)
    lw          t0,0x30(sp)
    lw          t1,0x34(sp)
    lw          t4,0x24(sp)
    sw          t0,0x10(sp)
    sw          t1,0x14(sp)
    sw          a0,0x18(sp)
    sw          t4,0x1C(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,7
    jal         _exceptldd
    nop
    lw          v0,0x18(sp)
    lw          ra,0x20(sp)
    b           gtd011
    nop
    .set        at
END(__gtd)

LEAF(__ned)
    .set        noat
    la          AT,_fsr
    lw          t1,0(AT)
    lui         t2,0xFFFE
    ori         t2,t2,0xFFF
    and         t1,t1,t2
    la          AT,_fsr
    sw          t1,0(AT)
    sll         t2,a1,1
    sll         t3,a3,1
    or          t3,t3,a0
    or          t3,t3,a2
    or          t2,t2,t3
    beq         zero,t2,ned001
    nop
    sll         t0,a1,1
    beq         zero,a0,ned002
    nop
    ori         t0,t0,1
ned002:
    sll         t1,a3,1
    beq         zero,a2,ned003
    nop
    ori         t1,t1,1
ned003:
    lui         AT,0xFFF0
    sltu        AT,t0,AT
    beq         zero,AT,ned004
    nop
    lui         AT,0xFFF0
    sltu        AT,t1,AT
    beq         zero,AT,ned004
    nop
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t0,AT
    beq         zero,AT,ned005
    nop
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t1,AT
    beq         zero,AT,ned005
    nop
    bne         a3,a1,ned005
    nop
    bne         a2,a0,ned005
    nop
ned001:
    ori         v0,zero,0
    b           ned006
    nop
ned004:
    la          AT,_fsr
    lw          t0,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t0,t0,AT
    la          AT,_fsr
    sw          t0,0(AT)
ned005:
    ori         v0,zero,1
ned006:
    jr          ra
    nop
    .set        at
END(__ned)

LEAF(_decomp)
    addiu       sp,sp,0xFFD0
    sw          ra,0x28(sp)
    sw          s8,0x10(sp)
    sw          s7,0x14(sp)
    sw          s6,0x18(sp)
    sw          s5,0x1C(sp)
    sw          s4,0x20(sp)
    sw          s3,0x24(sp)
    or          s7,a1,zero
    or          s8,a0,zero
    or          s3,a2,zero
    or          a3,zero,zero
    or          a2,zero,zero
    or          a1,s7,zero
    or          a0,s8,zero
    jal         __eqd
    sw          s7,0x34(sp)
    beq         zero,v0,decomp001
    nop
    or          v0,zero,zero
    or          v1,zero,zero
    b           decomp002
    or          s6,zero,zero
decomp001:
    lhu         s5,0x36(sp)
    andi        s4,s5,0xFFFF
    andi        s6,s4,0x7FF0
    andi        v0,s6,0xFFFF
    bnel        zero,v0,decomp003
    or          a2,zero,zero
    lui         v0,0xF
    ori         v0,v0,0xFFFF
    and         v0,s7,v0
    bnel        zero,v0,decomp004
    or          a3,zero,zero
    beql        zero,s8,decomp003
    or          a2,zero,zero
    or          a3,zero,zero
decomp004:
    or          a2,zero,zero
    or          a1,s7,zero
    or          a0,s8,zero
    jal         __ltd
    addiu       s6,zero,0xFC03
    beql        zero,v0,decomp005
    or          v1,zero,zero
    b           decomp005
    addiu       v1,zero,1
decomp005:
    andi        v0,s4,0x10
    bnel        zero,v0,decomp006
    andi        v0,s5,0xFFFF
decomp008:
    lui         v0,0x8000
    sll         s7,s7,1
    and         v0,s8,v0
    beq         zero,v0,decomp007
    sw          s7,0x34(sp)
    ori         s7,s7,1
    sw          s7,0x34(sp)
decomp007:
    lhu         s5,0x36(sp)
    andi        v0,s5,0xFFFF
    sll         s8,s8,1
    andi        v0,v0,0x10
    beq         zero,v0,decomp008
    addiu       s6,s6,0xFFFF
    andi        v0,s5,0xFFFF
decomp006:
    andi        v0,v0,0xFFEF
    or          a3,v0,zero
    beq         zero,v1,decomp009
    sh          a3,0x36(sp)
    andi        v0,v0,0xFFFF
    ori         v0,v0,0x8000
    sh          v0,0x36(sp)
decomp009:
    lw          a1,0x34(sp)
    or          a2,zero,zero
    jal         _set_exp
    or          a0,s8,zero
    b           decomp002
    nop
decomp003:
    or          a1,s7,zero
    jal         _set_exp
    or          a0,s8,zero
    andi        a3,s6,0xFFFF
    srl         a3,a3,4
    sll         a3,a3,0x10
    sra         a3,a3,0x10
    addiu       s6,a3,0xFC02
decomp002:
    sw          s6,0(s3)
    lw          s8,0x10(sp)
    lw          s7,0x14(sp)
    lw          s6,0x18(sp)
    lw          s5,0x1C(sp)
    lw          s4,0x20(sp)
    lw          s3,0x24(sp)
    lw          ra,0x28(sp)
    jr          ra
    addiu       sp,sp,0x30
END(_decomp)

LEAF(__dpmul)
    .set        noat
    addiu       sp,sp,0xFFD0
    sw          ra,0x28(sp)
    jal         __mice001
    nop
    xor         v0,a1,a3
    and         t1,v1,v0
    sltiu       AT,t9,0x7FE
    beq         zero,AT,dpmul001
    nop
dpmul020:
    addiu       t9,t7,0xFFFF
    sltiu       AT,t9,0x7FE
    beq         zero,AT,dpmul002
    nop
dpmul025:
    multu       t3,t6
    mflo        t9
    nop
    nop
    mfhi        v1
    nop
    nop
    multu       t2,t5
    mflo        t8
    nop
    nop
    mfhi        a2
    nop
    nop
    multu       t3,t5
    mflo        t5
    nop
    nop
    mfhi        a0
    nop
    nop
    addu        a2,a2,t5
    sltu        v0,a2,t5
    addu        t9,t9,a0
    addu        t9,t9,v0
    beq         a0,t9,dpmul003
    nop
    sltu        v0,t9,a0
dpmul003:
    addu        v1,v1,v0
    multu       t2,t6
    mflo        t2
    nop
    nop
    mfhi        a0
    nop
    nop
    addu        a2,a2,t2
    sltu        v0,a2,t2
    addu        t9,t9,a0
    addu        t9,t9,v0
    beq         a0,t9,dpmul004
    nop
    sltu        v0,t9,a0
dpmul004:
    addu        v1,v1,v0
    or          v0,t8,a2
    beq         zero,v0,dpmul005
    nop
    ori         t9,t9,1
dpmul005:
    or          t3,v1,zero
    or          t2,t9,zero
    bltz        t3,dpmul006
    nop
    slt         v0,t2,zero
    addu        t2,t2,t2
    addu        t3,t3,t3
    addu        t3,t3,v0
    addiu       t4,t4,0xFFFF
dpmul006:
    addiu       v0,t7,0xFC02
    addu        t4,t4,v0
    jal         __mice002
    nop
dpmul015:
    bne         zero,t9,dpmul007
    nop
dpmul008:
    lw          ra,0x28(sp)
    addiu       sp,sp,0x30
    jr          ra
    nop
dpmul007:
    lw          a2,8(sp)
    lw          a3,0xC(sp)
    sw          a0,0x18(sp)
    sw          a1,0x1C(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,3
    jal         _exceptddd
    nop
    b           dpmul008
    nop
dpmul001:
    addu        t3,t3,t3
    beq         zero,t4,dpmul009
    nop
    sltu        t9,zero,t2
    or          t9,t9,t3
    beq         zero,t9,dpmul010
    nop
    lui         AT,7
    ori         AT,AT,0xFFFF
    and         a1,a1,AT
    bgtz        t9,dpmul011
    nop
    or          t9,a0,a1
    beq         zero,t9,dpmul012
    nop
    ori         AT,zero,0x7FF
    bne         AT,t7,dpmul012
    nop
    addu        t9,t6,t6
    sltu        t8,zero,t5
    or          t9,t9,t8
    bgtz        t9,dpmul013
    nop
dpmul012:
    lui         a1,0x7FF7
    ori         a1,a1,0xFFFF
    addiu       a0,zero,0xFFFF
    b           dpmul013
    nop
dpmul011:
    ori         AT,zero,0x7FF
    bne         AT,t7,dpmul014
    nop
    addu        t9,t6,t6
    sltu        t8,zero,t5
    or          t9,t9,t8
    bgez        t9,dpmul014
    nop
dpmul013:
    lui         AT,1
    or          t0,t0,AT
dpmul014:
    lui         AT,0x7FF0
    or          a1,a1,AT
dpmul022:
    jal         __mice003
    nop
    b           dpmul015
    nop
dpmul010:
    addu        t9,t6,t6
    or          t9,t9,t5
    ori         AT,zero,0x7FF
    bne         AT,t7,dpmul016
    nop
    bne         zero,t9,dpmul002
    nop
dpmul017:
    jal         __mice004
    nop
    b           dpmul015
    nop
dpmul016:
    bne         zero,t7,dpmul017
    nop
    beq         zero,t9,dpmul012
    nop
    b           dpmul017
    nop
dpmul009:
    or          v0,t3,t2
    beq         zero,v0,dpmul018
    nop
    srl         t3,t3,1
    addiu       t4,t4,1
    bne         zero,t3,dpmul019
    nop
    addiu       t4,t4,0xFFE0
    or          t3,t2,zero
    ori         t2,zero,0
dpmul019:
    blez        t3,dpmul020
    nop
    slt         v0,t2,zero
    addu        t2,t2,t2
    addu        t3,t3,t3
    addu        t3,t3,v0
    addiu       t4,t4,0xFFFF
    b           dpmul019
    nop
dpmul018:
    ori         AT,zero,0x7FF
    bne         AT,t7,dpmul021
    nop
    addu        t9,t6,t6
    or          t9,t9,t5
    bne         zero,t9,dpmul002
    nop
    b           dpmul012
    nop
dpmul021:
    or          a1,t1,zero
    ori         a0,zero,0
    b           dpmul022
    nop
dpmul002:
    addu        t6,t6,t6
    bne         zero,t7,dpmul023
    nop
    or          v0,t6,t5
    beq         zero,v0,dpmul021
    nop
    srl         t6,t6,1
    addiu       t7,t7,1
    bne         zero,t6,dpmul024
    nop
    addiu       t7,t7,0xFFE0
    or          t6,t5,zero
    ori         t5,zero,0
dpmul024:
    blez        t6,dpmul025
    nop
    slt         v0,t5,zero
    addu        t5,t5,t5
    addu        t6,t6,t6
    addu        t6,t6,v0
    addiu       t7,t7,0xFFFF
    b           dpmul024
    nop
dpmul023:
    bltz        t6,dpmul012
    nop
    lui         AT,0x7FFF
    ori         AT,AT,0xFFFF
    and         a3,a3,AT
    or          v0,t6,t5
    bne         zero,v0,dpmul026
    nop
    lui         AT,0x7FF0
    or          a3,t1,AT
dpmul026:
    or          a0,a2,zero
    or          a1,a3,zero
    b           dpmul022
    nop
    .set        at
END(__dpmul)

LEAF(__mice001)    //40145AE0
    .set        noat
    la          AT,_fsr
    lw          t0,0(AT)
    xori        t8,t0,0xF80
    sw          t8,0x20(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t0,t0,t8
    sw          a0,8(sp)
    sw          a1,0xC(sp)
    sw          a2,0x10(sp)
    sw          a3,0x14(sp)
    sll         t4,a1,1
    srl         t4,t4,0x15
    sll         t3,a1,0xB
    srl         v0,a0,0x15
    or          t3,t3,v0
    sll         t2,a0,0xB
    lui         v1,0x8000
    or          t3,t3,v1
    sll         t7,a3,1
    srl         t7,t7,0x15
    sll         t6,a3,0xB
    srl         v0,a2,0x15
    or          t6,t6,v0
    sll         t5,a2,0xB
    or          t6,t6,v1
    addiu       t9,t4,0xFFFF
    jr          ra
    nop
    .set        at
END(__mice001)

LEAF(__mice002)    //40145B58
    .set        noat
    andi        t9,t2,0x7FF
    beq         zero,t9,mice00201
    nop
    ori         t0,t0,0x1000
    andi        t9,t0,3
    ori         AT,zero,1
    beq         AT,t9,mice00201
    nop
    ori         v0,zero,0x400
    beq         zero,t9,mice00202
    nop
    sll         t9,t9,0x1F
    xor         t9,t9,t1
    bne         zero,t9,mice00201
    nop
    ori         v0,zero,0x800
mice00202:
    nor         t9,v0,zero
    andi        t9,t9,0xFFF
    and         t9,t9,t2
    beq         zero,t9,mice00201
    nop
    addu        t2,t2,v0
    sltu        t9,t2,v0
    addu        t3,t3,t9
    sltu        t9,t3,t9
    addu        t4,t4,t9
mice00201:
    blez        t4,__miky001
    nop
    sltiu       AT,t4,0x7FF
    beq         zero,AT,__miky002
    nop
    srl         a0,t2,0xB
    sll         v0,t3,0x15
    or          a0,a0,v0
    sll         a1,t3,1
    srl         a1,a1,0xC
    sll         v0,t4,0x14
    or          a1,a1,v0
    or          a1,a1,t1
    srl         t9,t0,5
    andi        t9,t9,0xF80
    srl         t8,t9,5
    or          t0,t0,t8
    la          AT,_fsr
    sw          t0,0(AT)
    and         t9,t9,t0
    or          v1,a1,zero
    or          v0,a0,zero
    jr          ra
    nop
    .set        at
END(__mice002)

LEAF(__mice003)    //40145BF4
    .set        noat
    srl         t9,t0,5
    andi        t9,t9,0xF80
    srl         t8,t9,5
    or          t0,t0,t8
    la          AT,_fsr
    sw          t0,0(AT)
    and         t9,t9,t0
    or          v1,a1,zero
    or          v0,a0,zero
    jr          ra
    nop
    .set        at
END(__mice003)

LEAF(__mice004)    //40145BD4
    .set        noat
    srl         a0,t2,0xB
    sll         v0,t3,0x15
    or          a0,a0,v0
    sll         a1,t3,1
    srl         a1,a1,0xC
    sll         v0,t4,0x14
    or          a1,a1,v0
    or          a1,a1,t1
    srl         t9,t0,5
    andi        t9,t9,0xF80
    srl         t8,t9,5
    or          t0,t0,t8
    la          AT,_fsr
    sw          t0,0(AT)
    and         t9,t9,t0
    or          v1,a1,zero
    or          v0,a0,zero
    jr          ra
    nop
    .set        at
END(__mice004)

LEAF(__miky001)    //40145C24
    .set        noat
    bne         zero,t4,miky00101
    nop
    or          t9,t2,t3
    beq         zero,t9,__miky003
    nop
miky00101:
    andi        t9,t0,0x100
    beq         zero,t9,miky00102
    nop
    addiu       t4,t4,0x600
    ori         t0,t0,0x3000
    b           __mice004
    nop
miky00102:
    ori         t9,zero,1
    subu        t9,t9,t4
    ori         v0,zero,0x40
    subu        v0,v0,t9
    sllv        t8,t2,v0
    srlv        t2,t2,t9
    sllv        t7,t3,v0
    or          t2,t2,t7
    srlv        t3,t3,t9
    sltiu       AT,t9,0x20
    bne         zero,AT,miky00103
    nop
    or          t8,t8,t2
    or          t2,t3,zero
    ori         t3,zero,0
    sltiu       AT,t9,0x40
    bne         zero,AT,miky00103
    nop
    or          t8,t8,t2
    ori         t2,zero,0
miky00103:
    andi        v0,t2,0x7FF
    or          t8,t8,v0
    beq         zero,t8,miky00104
    nop
    ori         t0,t0,0x1000
miky00104:
    lui         AT,0x100
    and         t9,t0,AT
    beq         zero,t9,miky00105
    nop
    ori         t2,zero,0
    ori         t3,zero,0
    ori         t4,zero,0
    lui         AT,0x7FF0
    and         t9,a1,AT
    beq         zero,t9,miky00106
    nop
    lui         AT,0x7FF0
    and         t9,a3,AT
    bne         zero,t9,miky00107
    nop
miky00106:
    ori         t1,zero,0
    addiu       AT,zero,0xEFFF
    and         t0,t0,AT
    b           __miky003
    nop
miky00107:
    ori         t0,t0,0x3000
    andi        t9,t0,3
    slti        AT,t9,2
    bne         zero,AT,__miky003
    nop
    sll         t9,t9,0x1F
    xor         t9,t9,t1
    bne         zero,t9,__miky003
    nop
    ori         t4,zero,1
    b           __miky003
    nop
miky00105:
    ori         t4,zero,0
    bne         zero,t8,miky00108
    nop
    lui         AT,0x7FF0
    and         t9,a1,AT
    beq         zero,t9,__miky003
    nop
    lui         AT,0x7FF0
    and         t9,a3,AT
    beq         zero,t9,__miky003
    nop
    andi        t9,t0,0x1000
    beq         zero,t9,__miky003
    nop
miky00108:
    ori         t0,t0,0x3000
    b           __miky003
    nop
    ori         t0,t0,0x5000
    addi        t4,t4,0xFA00
    andi        t9,t0,0x200
    beq         zero,t9,miky00109
    nop
    sltiu       AT,t4,0x7FF
    bne         zero,AT,__mice004
    nop
miky00109:
    ori         t4,zero,0x7FF
    ori         t2,zero,0
    ori         t3,zero,0
    andi        t9,t0,3
    slti        AT,t9,2
    bne         zero,AT,miky00110
    nop
    srl         t8,t1,0x1F
    xor         t9,t9,t8
    andi        t9,t9,1
miky00110:
    beq         zero,t9,__mice004
    nop
    ori         t4,zero,0x7FE
    addiu       t3,zero,0xFFFF
    or          t2,t3,zero
    b           __mice004
    nop
    .set        at
END(__miky001)

LEAF(__miky002)    //40145D7C
    .set        noat
    ori         t0,t0,0x5000
    addi        t4,t4,0xFA00
    andi        t9,t0,0x200
    beq         zero,t9,miky00201
    nop
    sltiu       AT,t4,0x7FF
    bne         zero,AT,__mice004
    nop
miky00201:
    ori         t4,zero,0x7FF
    ori         t2,zero,0
    ori         t3,zero,0
    andi        t9,t0,3
    slti        AT,t9,2
    bne         zero,AT,miky00202
    nop
    srl         t8,t1,0x1F
    xor         t9,t9,t8
    andi        t9,t9,1
miky00202:
    beq         zero,t9,__mice004
    nop
    ori         t4,zero,0x7FE
    addiu       t3,zero,0xFFFF
    or          t2,t3,zero
    b           __mice004
    nop
    .set        at
END(__miky002)

LEAF(__miky003)    //40145BC8
    .set        noat
    sltiu       AT,t4,0x7FF
    beq         zero,AT,__miky002
    nop
    srl         a0,t2,0xB
    sll         v0,t3,0x15
    or          a0,a0,v0
    sll         a1,t3,1
    srl         a1,a1,0xC
    sll         v0,t4,0x14
    or          a1,a1,v0
    or          a1,a1,t1
    srl         t9,t0,5
    andi        t9,t9,0xF80
    srl         t8,t9,5
    or          t0,t0,t8
    la          AT,_fsr
    sw          t0,0(AT)
    and         t9,t9,t0
    or          v1,a1,zero
    or          v0,a0,zero
    jr          ra
    nop
    .set        at
END(__miky003)

LEAF(_exceptddd)
    addiu       sp,sp,0xFFD0
    sw          ra,0x28(sp)
    lw          v0,0x50(sp)
    sw          v0,0x20(sp)
    lw          v0,0x4C(sp)
    sw          v0,0x1C(sp)
    lw          v0,0x48(sp)
    sw          v0,0x18(sp)
    lw          v0,0x44(sp)
    sw          v0,0x14(sp)
    lw          v0,0x40(sp)
    jal         _except2
    sw          v0,0x10(sp)
    lw          ra,0x28(sp)
    jr          ra
    addiu       sp,sp,0x30
END(_exceptddd)

LEAF(_except2)
    addiu       sp,sp,0xFF80
    sw          ra,0x78(sp)
    sw          s8,0x70(sp)
    sw          s7,0x74(sp)
    sw          a2,0x88(sp)
    or          s8,a0,zero
    or          s7,a1,zero
    lw          a2,0xA0(sp)
    addiu       a1,sp,0x98
    or          a0,s8,zero
    jal         _handle_exc
    sw          a3,0x8C(sp)
    bne         zero,v0,except201
    nop
    lui         v1,0xFFFF
    lw          v0,0x50(sp)
    ori         v1,v1,0xFFE3
    and         v0,v0,v1
    ori         v0,v0,3
    sw          v0,0x50(sp)
    lw          v0,0x90(sp)
    or          a3,s7,zero
    sw          v0,0x40(sp)
    lw          v0,0x94(sp)
    or          a2,s8,zero
    sw          v0,0x44(sp)
    addiu       v0,sp,0x98
    sw          v0,0x14(sp)
    addiu       v0,sp,0x88
    addiu       a1,sp,0xA0
    addiu       a0,sp,0x18
    jal         _raise_exc
    sw          v0,0x10(sp)
except201:
    lui         a1,0xFFFF
    lw          a0,0xA0(sp)
    jal         _ctrlfp
    ori         a1,a1,0xFF83
    lw          v0,0x98(sp)
    lw          v1,0x9C(sp)
    lw          s8,0x70(sp)
    lw          s7,0x74(sp)
    lw          ra,0x78(sp)
    jr          ra
    addiu       sp,sp,0x80
END(_except2)

LEAF(__ltd)
    .set        noat
    addiu       sp,sp,0xFFD8
    sw          ra,0x20(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x24(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,0x28(sp)
    sw          a1,0x2C(sp)
    sw          a2,0x30(sp)
    sw          a3,0x34(sp)
    sll         t2,a1,1
    sll         t3,a3,1
    or          t3,t3,a0
    or          t3,t3,a2
    or          t2,t2,t3
    beq         zero,t2,ltd001
    nop
    sll         t0,a1,1
    beq         zero,a0,ltd002
    nop
    ori         t0,t0,1
ltd002:
    sll         t1,a3,1
    beq         zero,a2,ltd003
    nop
    ori         t1,t1,1
ltd003:
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t0,AT
    beq         zero,AT,ltd004
    nop
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t1,AT
    beq         zero,AT,ltd004
    nop
    bgez        a1,ltd005
    nop
    bgez        a3,ltd006
    nop
    sltu        t2,a0,a2
    subu        a0,a0,a2
    subu        a1,a1,t2
    addiu       AT,zero,0xFFFF
    beq         AT,a1,ltd007
    nop
    sltu        t2,a1,a3
ltd007:
    subu        a1,a1,a3
    bne         zero,t2,ltd008
    nop
    or          t2,a1,a0
    bne         zero,t2,ltd006
    nop
    b           ltd001
    nop
ltd005:
    bltz        a3,ltd008
    nop
    sltu        t2,a0,a2
    subu        a0,a0,a2
    subu        a1,a1,t2
    addiu       AT,zero,0xFFFF
    beq         AT,a1,ltd009
    nop
    sltu        t2,a1,a3
ltd009:
    subu        a1,a1,a3
    beq         zero,t2,ltd010
    nop
ltd006:
    ori         v0,zero,1
    b           ltd011
    nop
ltd010:
    or          t2,a1,a0
    beq         zero,t2,ltd001
    nop
ltd008:
    ori         v0,zero,0
    b           ltd011
    nop
ltd001:
    ori         v0,zero,0
ltd011:
    addiu       sp,sp,0x28
    jr          ra
    nop
ltd004:
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    ori         a0,zero,0
    lw          a2,0x28(sp)
    lw          a3,0x2C(sp)
    lw          t0,0x30(sp)
    lw          t1,0x34(sp)
    lw          t4,0x24(sp)
    sw          t0,0x10(sp)
    sw          t1,0x14(sp)
    sw          a0,0x18(sp)
    sw          t4,0x1C(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,7
    jal         _exceptldd
    nop
    lw          v0,0x18(sp)
    lw          ra,0x20(sp)
    b           ltd011
    nop
    .set        at
END(__ltd)

LEAF(_stATfp)
    .set        noat
    la          AT,_fsr
    lw          v0,0(AT)
    jr          ra
    nop
    .set        at
END(_stATfp)

LEAF(_clrfp)
    .set        noat
    la          AT,_fsr
    lw          v0,0(AT)
    addiu       AT,zero,0xFF83
    and         t0,v0,AT
    la          AT,_fsr
    sw          t0,0(AT)
    jr          ra
    nop
    .set        at
END(_clrfp)

LEAF(_exceptldd)
    addiu       sp,sp,0xFFC0
    sw          ra,0x38(sp)
    sw          s8,0x28(sp)
    sw          s7,0x2C(sp)
    sw          s6,0x30(sp)
    sw          s5,0x34(sp)
    or          s5,a0,zero
    lw          a0,0x58(sp)
    or          s8,a3,zero
    or          s7,a2,zero
    jal         __litodp
    or          s6,a1,zero
    or          a2,s7,zero
    or          a1,s6,zero
    sw          v0,0x18(sp)
    lw          v0,0x54(sp)
    lw          a3,0x5C(sp)
    sw          v0,0x14(sp)
    lw          v0,0x50(sp)
    sw          a3,0x20(sp)
    or          a3,s8,zero
    or          a0,s5,zero
    sw          v1,0x1C(sp)
    jal         _except2
    sw          v0,0x10(sp)
    or          a1,zero,zero
    or          a0,zero,zero
    or          s6,v1,zero
    jal         _controlfp
    or          s7,v0,zero
    lui         s8,8
    ori         s8,s8,0x1F
    or          a1,s8,zero
    or          a0,s8,zero
    jal         _controlfp
    or          s5,v0,zero
    or          a1,s8,zero
    jal         _controlfp
    or          a0,s5,zero
    or          a1,s6,zero
    jal         __dptoli
    or          a0,s7,zero
    lw          s8,0x28(sp)
    lw          s7,0x2C(sp)
    lw          s6,0x30(sp)
    lw          s5,0x34(sp)
    lw          ra,0x38(sp)
    jr          ra
    addiu       sp,sp,0x40
END(_exceptldd)

LEAF(_set_exp)
    addiu       sp,sp,0xFFF8
    sw          a1,0xC(sp)
    sw          a1,4(sp)
    lhu         v1,0xE(sp)
    andi        v1,v1,0xFFFF
    addiu       v0,a2,0x3FE
    sll         v0,v0,4
    andi        v1,v1,0x800F
    or          v0,v0,v1
    andi        v0,v0,0xFFFF
    sh          v0,6(sp)
    lw          v1,4(sp)
    or          v0,a0,zero
    jr          ra
    addiu       sp,sp,8
END(_set_exp)

LEAF(__litodp)
    addiu       sp,sp,0xFFE8
    ori         a3,zero,0x41E
    ori         a1,zero,0
    or          t2,a1,zero
    or          a2,a0,zero
    bne         zero,a2,litodp001
    nop
    ori         a3,zero,0
    b           litodp002
    nop
litodp001:
    bgez        a2,litodp003
    nop
    lui         t2,0x8000
    sltu        t3,zero,a1
    subu        a1,zero,a1
    subu        a2,zero,a2
    subu        a2,a2,t3
litodp003:
    blez        a2,litodp002
    nop
    addu        a2,a2,a2
    addiu       a3,a3,0xFFFF
    b           litodp003
    nop
litodp002:
    srl         t0,a1,0xB
    sll         t3,a2,0x15
    or          t0,t0,t3
    sll         t1,a2,1
    srl         t1,t1,0xC
    sll         t3,a3,0x14
    or          t1,t1,t3
    or          t1,t1,t2
    or          v0,t0,zero
    or          v1,t1,zero
    addiu       sp,sp,0x18
    jr          ra
    nop
END(__litodp)

LEAF(__dptoli)
    .set        noat
    addiu       sp,sp,0xFFE0
    sw          ra,0x18(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x14(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,8(sp)
    sw          a1,0xC(sp)
    sll         t3,a1,1
    srl         t3,t3,0x15
    sll         t2,a1,0xB
    srl         t4,a0,0x15
    or          t2,t2,t4
    sll         t1,a0,0xB
    lui         AT,0x8000
    or          t2,t2,AT
    sltiu       AT,t3,0x41E
    beq         zero,AT,dptoli001
    nop
    bne         zero,t3,dptoli002
    nop
    sll         t2,t2,1
    srl         t2,t2,1
dptoli002:
    ori         a2,zero,0x41E
    subu        a2,a2,t3
dptoli005:
    sltiu       AT,a2,0x20
    bne         zero,AT,dptoli003
    nop
    addi        a2,a2,0xFFE0
    sltu        t0,zero,t1
    or          t1,t2,t0
    beq         t2,zero,dptoli004
    nop
    ori         t2,zero,0
    b           dptoli005
    nop
dptoli003:
    ori         a3,zero,0x20
    sub         a3,a3,a2
    sllv        t0,t1,a3
    srlv        t0,t0,a3
    sllv        a3,t2,a3
    srlv        t1,t1,a2
    srlv        t2,t2,a2
    or          t1,a3,t1
    or          t1,t1,t0
    b           dptoli004
    nop
    lui         AT,0x8000
    ori         AT,AT,1
    sltu        AT,t1,AT
    beq         zero,AT,dptoli006
    nop
    lui         AT,0x8000
    sltu        AT,t1,AT
    bne         zero,AT,dptoli004
    nop
    srl         t2,t2,1
    sll         t2,t2,1
    b           dptoli004
    nop
    beq         zero,t1,dptoli007
    nop
    bgez        a1,dptoli006
    nop
    b           dptoli004
    nop
    beq         zero,t1,dptoli007
    nop
    bgez        a1,dptoli004
    nop
dptoli006:
    addiu       t9,t2,1
    slt         AT,t2,t9
    bne         zero,AT,dptoli008
    nop
    bgez        a1,dptoli009
    nop
dptoli008:
    or          t2,t9,zero
dptoli004:
    beq         zero,t1,dptoli007
    nop
    la          AT,_fsr
    lw          t9,0(AT)
    ori         t9,t9,0x1004
    la          AT,_fsr
    sw          t9,0(AT)
dptoli007:
    bgez        a1,dptoli010
    nop
    subu        t2,zero,t2
dptoli010:
    or          v0,t2,zero
dptoli011:
    addiu       sp,sp,0x20
    jr          ra
    nop
dptoli001:
    lui         AT,0xC1E0
    bne         AT,a1,dptoli009
    nop
    beq         zero,a0,dptoli010
    nop
dptoli009:
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    lui         a0,0x7FFF
    ori         a0,a0,0xFFFF
    lw          a2,8(sp)
    lw          a3,0xC(sp)
    sw          a0,0x10(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,8
    jal         _exceptld
    nop
    lw          v0,0x10(sp)
    lw          ra,0x18(sp)
    b           dptoli011
    nop
    .set        at
END(__dptoli)

LEAF(_exceptld)
    addiu       sp,sp,0xFFC8
    sw          ra,0x30(sp)
    sw          s8,0x20(sp)
    sw          s7,0x24(sp)
    sw          s6,0x28(sp)
    sw          s5,0x2C(sp)
    or          s5,a0,zero
    lw          a0,0x48(sp)
    or          s8,a3,zero
    or          s7,a2,zero
    jal         __litodp
    or          s6,a1,zero
    lw          a3,0x4C(sp)
    or          a2,s7,zero
    sw          a3,0x18(sp)
    or          a3,s8,zero
    or          a1,s6,zero
    or          a0,s5,zero
    sw          v1,0x14(sp)
    jal         _except1
    sw          v0,0x10(sp)
    or          a1,zero,zero
    or          a0,zero,zero
    or          s6,v1,zero
    jal         _controlfp
    or          s7,v0,zero
    lui         s8,8
    ori         s8,s8,0x1F
    or          a1,s8,zero
    or          a0,s8,zero
    jal         _controlfp
    or          s5,v0,zero
    or          a1,s8,zero
    jal         _controlfp
    or          a0,s5,zero
    or          a1,s6,zero
    jal         __dptoli
    or          a0,s7,zero
    lw          s8,0x20(sp)
    lw          s7,0x24(sp)
    lw          s6,0x28(sp)
    lw          s5,0x2C(sp)
    lw          ra,0x30(sp)
    jr          ra
    addiu       sp,sp,0x38
END(_exceptld)

LEAF(__eqd)
    .set        noat
    la          AT,_fsr
    lw          t1,0(AT)
    lui         t2,0xFFFE
    ori         t2,t2,0xFFF
    and         t1,t1,t2
    la          AT,_fsr
    sw          t1,0(AT)
    sll         t2,a1,1
    sll         t3,a3,1
    or          t3,t3,a0
    or          t3,t3,a2
    or          t2,t2,t3
    beq         zero,t2,eqd001
    nop
    sll         t0,a1,1
    beq         zero,a0,eqd002
    nop
    ori         t0,t0,1
eqd002:
    sll         t1,a3,1
    beq         zero,a2,eqd003
    nop
    ori         t1,t1,1
eqd003:
    lui         AT,0xFFF0
    sltu        AT,t0,AT
    beq         zero,AT,eqd004
    nop
    lui         AT,0xFFF0
    sltu        AT,t1,AT
    beq         zero,AT,eqd004
    nop
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t0,AT
    beq         zero,AT,eqd005
    nop
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t1,AT
    beq         zero,AT,eqd005
    nop
    bne         a3,a1,eqd005
    nop
    bne         a2,a0,eqd005
    nop
eqd001:
    ori         v0,zero,1
    b           eqd006
    nop
eqd004:
    la          AT,_fsr
    lw          t0,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t0,t0,AT
    la          AT,_fsr
    sw          t0,0(AT)
eqd005:
    ori         v0,zero,0
eqd006:
    jr          ra
    nop
    .set        at
END(__eqd)

LEAF(__eqs)
    .set        noat
    sw          a0,0(sp)
    sw          a1,4(sp)
    sll         a2,a0,1
    sll         a3,a1,1
    or          t0,a2,a3
    beq         zero,t0,eqs001
    nop
    lui         AT,0xFF80
    sltu        AT,a2,AT
    beq         zero,AT,eqs002
    nop
    lui         AT,0xFF80
    sltu        AT,a3,AT
    beq         zero,AT,eqs002
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a2,AT
    beq         zero,AT,eqs003
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a3,AT
    beq         zero,AT,eqs003
    nop
    bne         a1,a0,eqs003
    nop
eqs001:
    ori         v0,zero,1
eqs004:
    jr          ra
    nop
eqs002:
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
eqs003:
    ori         v0,zero,0
    b           eqs004
    nop
    .set        at
END(__eqs)

#endif

//
// Only for compile
//
LEAF(__ll_to_d)
    .set noreoder
    break 0
    nop
    .set reoder
END(__ll_to_d)

LEAF(__ll_div)
    addiu       sp,sp,0xFFC8
    sw          ra,0x30(sp)
    sw          s8,0x28(sp)
    sw          s7,0x2C(sp)
    or          v0,a3,zero
    or          v1,a2,zero
    or          s8,zero,zero
    or          a2,a0,zero
    or          a3,a1,zero
    bgez        a1,__ll_div_1
    addiu       s7,zero,1
    bne         zero,a0,__ll_div_2
    or          s8,s7,zero
    b           __ll_div_3
    or          a3,s7,zero
__ll_div_2:
    or          a3,zero,zero
__ll_div_3:
    nor         a1,a1,zero
    addu        a3,a1,a3
    subu        a2,zero,a2
__ll_div_1:
    bgez        v0,__ll_div_4
    nop
    bnel        zero,s8,__ll_div_5
    or          s8,zero,zero
    b           __ll_div_5
    or          s8,s7,zero
__ll_div_5:
    bnel        zero,v1,__ll_div_6
    or          a1,zero,zero
    b           __ll_div_6
    or          a1,s7,zero
__ll_div_6:
    nor         v0,v0,zero
    addu        v0,v0,a1
    subu        v1,zero,v1
__ll_div_4:
    bnel        zero,v0,__ll_div_7
    addiu       a1,sp,0x20
    lui         a1,1
    sltu        a1,v1,a1
    beql        zero,a1,__ll_div_7
    addiu       a1,sp,0x20
    addiu       a1,sp,0x20
    addiu       a0,sp,0x18
    sw          v0,0x14(sp)
    jal         __ull_divrem_6416
    sw          v1,0x10(sp)
    b           __ll_div_8
    nop
__ll_div_7:
    addiu       a0,sp,0x18
    sw          v1,0x10(sp)
    jal         __ll_div_9
    sw          v0,0x14(sp)
__ll_div_8:
    beq         zero,s8,__ll_div_10
    nop
    lw          a3,0x18(sp)
    bnel        zero,a3,__ll_div_11
    or          v0,zero,zero
    b           __ll_div_11
    or          v0,s7,zero
__ll_div_11:
    lw          v1,0x1C(sp)
    nor         v1,v1,zero
    addu        v1,v1,v0
    b           __ll_div_12
    subu        v0,zero,a3
__ll_div_10:
    lw          v0,0x18(sp)
    lw          v1,0x1C(sp)
__ll_div_12:
    lw          s8,0x28(sp)
    lw          s7,0x2C(sp)
    lw          ra,0x30(sp)
    jr          ra
    addiu       sp,sp,0x38
__ll_div_9:
    addiu       sp,sp,0xFFC8
    sw          ra,0x34(sp)
    sw          s8,0x10(sp)
    sw          s7,0x14(sp)
    sw          s6,0x18(sp)
    sw          s5,0x1C(sp)
    sw          s4,0x20(sp)
    sw          s3,0x24(sp)
    sw          s2,0x28(sp)
    sw          s1,0x2C(sp)
    sw          s0,0x30(sp)
    or          s6,a3,zero
    or          s4,a2,zero
    or          s1,a0,zero
    or          s0,a1,zero
    or          a0,s4,zero
    or          a1,s6,zero
    jal         __ll_div_13
    sw          s1,0x38(sp)
    lw          s5,0x48(sp)
    lw          s7,0x4C(sp)
    or          a0,s5,zero
    or          a1,s7,zero
    jal         __ll_div_13
    or          s8,v0,zero
    subu        s8,v0,s8
    blezl       s8,__ll_div_14
    or          s3,zero,zero
    or          a2,s8,zero
    or          a1,s7,zero
    jal         __ll_lshift
    or          a0,s5,zero
    or          s5,v0,zero
    or          s7,v1,zero
    or          s3,zero,zero
__ll_div_14:
    bltz        s8,__ll_div_15
    or          s2,zero,zero
    addiu       s1,s8,1
    addiu       s8,zero,1
__ll_div_20:
    or          a2,s8,zero
    or          a1,s2,zero
    jal         __ll_lshift
    or          a0,s3,zero
    or          s3,v0,zero
    bne         s7,s6,__ll_div_16
    or          s2,v1,zero
    sltu        v0,s4,s5
    beql        zero,v0,__ll_div_17
    sltu        v0,s4,s5
    b           __ll_div_18
    or          a2,s8,zero
__ll_div_16:
    sltu        v0,s7,s6
    beql        zero,v0,__ll_div_18
    or          a2,s8,zero
    sltu        v0,s4,s5
__ll_div_17:
    beql        zero,v0,__ll_div_19
    or          v0,zero,zero
    b           __ll_div_19
    or          v0,s8,zero
__ll_div_19:
    subu        v0,s6,v0
    subu        s6,v0,s7
    subu        s4,s4,s5
    ori         s3,s3,1
    or          a2,s8,zero
__ll_div_18:
    or          a1,s7,zero
    jal         __ull_rshift
    or          a0,s5,zero
    or          s5,v0,zero
    addiu       s1,s1,0xFFFF
    bne         zero,s1,__ll_div_20
    or          s7,v1,zero
    lw          s1,0x38(sp)
__ll_div_15:
    sw          s3,0(s1)
    sw          s2,4(s1)
    sw          s4,0(s0)
    sw          s6,4(s0)
    lw          s8,0x10(sp)
    lw          s7,0x14(sp)
    lw          s6,0x18(sp)
    lw          s5,0x1C(sp)
    lw          s4,0x20(sp)
    lw          s3,0x24(sp)
    lw          s2,0x28(sp)
    lw          s1,0x2C(sp)
    lw          s0,0x30(sp)
    lw          ra,0x34(sp)
    jr          ra
    addiu       sp,sp,0x38
__ll_div_13:
    bne         zero,a1,__ll_div_21
    or          v0,zero,zero
    beq         zero,a0,__ll_div_22
    nop
    lui         v1,0x8000
    and         a3,a0,v1
    bne         zero,a3,__ll_div_22
    addiu       v0,zero,0x20
__ll_div_23:
    sll         a0,a0,1
    and         a3,a0,v1
    beq         zero,a3,__ll_div_23
    addiu       v0,v0,1
    b           __ll_div_22
    nop
__ll_div_21:
    lui         v1,0x8000
    and         a3,a1,v1
    bne         zero,a3,__ll_div_22
    nop
__ll_div_24:
    sll         a1,a1,1
    and         a3,a1,v1
    beq         zero,a3,__ll_div_24
    addiu       v0,v0,1
__ll_div_22:
    jr          ra
    nop
END(__ll_div)

LEAF(__ll_rem)
    addiu       sp,sp,0xFFC8
    sw          ra,0x30(sp)
    sw          s8,0x28(sp)
    sw          s7,0x2C(sp)
    or          v0,a3,zero
    or          v1,a2,zero
    or          s8,zero,zero
    or          a2,a0,zero
    or          a3,a1,zero
    bgez        a1,__ll_rem_1
    addiu       s7,zero,1
    bne         zero,a0,__ll_rem_2
    or          s8,s7,zero
    b           __ll_rem_3
    or          a3,s7,zero
__ll_rem_2:
    or          a3,zero,zero
__ll_rem_3:
    nor         a1,a1,zero
    addu        a3,a1,a3
    subu        a2,zero,a2
__ll_rem_1:
    bgez        v0,__ll_rem_4
    nop
    bnel        zero,v1,__ll_rem_5
    or          a1,zero,zero
    b           __ll_rem_5
    or          a1,s7,zero
__ll_rem_5:
    nor         v0,v0,zero
    addu        v0,v0,a1
    subu        v1,zero,v1
__ll_rem_4:
    bnel        zero,v0,__ll_rem_6
    addiu       a1,sp,0x18
    lui         a1,1
    sltu        a1,v1,a1
    beql        zero,a1,__ll_rem_6
    addiu       a1,sp,0x18
    addiu       a1,sp,0x18
    addiu       a0,sp,0x20
    sw          v0,0x14(sp)
    jal         __ull_divrem_6416
    sw          v1,0x10(sp)
    b           __ll_rem_7
    nop
__ll_rem_6:
    addiu       a0,sp,0x20
    sw          v1,0x10(sp)
    jal         __ll_div_9
    sw          v0,0x14(sp)
__ll_rem_7:
    beq         zero,s8,__ll_rem_8
    nop
    lw          a3,0x18(sp)
    bnel        zero,a3,__ll_rem_9
    or          v0,zero,zero
    b           __ll_rem_9
    or          v0,s7,zero
__ll_rem_9:
    lw          v1,0x1C(sp)
    nor         v1,v1,zero
    addu        v1,v1,v0
    b           __ll_rem_10
    subu        v0,zero,a3
__ll_rem_8:
    lw          v0,0x18(sp)
    lw          v1,0x1C(sp)
__ll_rem_10:
    lw          s8,0x28(sp)
    lw          s7,0x2C(sp)
    lw          ra,0x30(sp)
    jr          ra
    addiu       sp,sp,0x38
END(__ll_rem)

LEAF(__ull_divrem_6416)
    .set        noat
    or          t0,a2,zero
    or          t1,a3,zero
    lw          t2,0x10(sp)
    lw          t3,0x14(sp)
    divu        t0,t2
    nop
    nop
    sra         t4,t0,0x1F
    bne         zero,t3,ulldivrem01
    nop
    bne         zero,t1,ulldivrem02
    nop
    mflo        v0
    nop
    nop
    mfhi        t4
    nop
    nop
    sw          v0,0(a0)
    sw          zero,4(a0)
    sw          t4,0(a1)
    sw          zero,4(a1)
    jr          ra
    nop
ulldivrem02:
    srl         t4,t2,0x10
    bne         zero,t4,ulldivrem01
    nop
    or          v0,a3,zero
    srl         v0,v0,0x10
    divu        v0,t2
    nop
    nop
    mflo        v1
    nop
    nop
    mfhi        v0
    nop
    nop
    sh          v1,6(a0)
    sll         v0,v0,0x10
    sll         t0,a3,0x10
    srl         t0,t0,0x10
    or          v0,v0,t0
    divu        v0,t2
    nop
    nop
    mflo        v1
    nop
    nop
    mfhi        v0
    nop
    nop
    sh          v1,4(a0)
    sll         v0,v0,0x10
    or          t0,a2,zero
    srl         t0,t0,0x10
    or          v0,v0,t0
    divu        v0,t2
    nop
    nop
    mflo        v1
    nop
    nop
    mfhi        v0
    nop
    nop
    sh          v1,2(a0)
    sll         v0,v0,0x10
    sll         t0,a2,0x10
    srl         t0,t0,0x10
    or          v0,v0,t0
    divu        v0,t2
    nop
    nop
    mflo        v1
    nop
    nop
    mfhi        v0
    nop
    nop
    sh          v1,0(a0)
    sw          zero,4(a1)
    sw          v0,0(a1)
    jr          ra
    nop
ulldivrem01:
    lw          t0,0x14(sp)
    sltu        AT,t0,a3
    bne         zero,AT,ulldivrem03
    nop
    sltu        AT,a3,t0
    bne         zero,AT,ulldivrem04
    nop
    lw          t0,0x10(sp)
    sltu        AT,a2,t0
    beq         zero,AT,ulldivrem03
    nop
ulldivrem04:
    sw          zero,0(a0)
    sw          zero,4(a0)
    sw          a2,0(a1)
    sw          a3,4(a1)
    jr          ra
    nop
ulldivrem03:
    break 0
    .set        at
END(__ull_divrem_6416)

LEAF(__ll_lshift)
    andi        a2,a2,0x3F
    ori         t1,zero,0x20
    subu        t1,t1,a2
    bgtz        t1,lllshift1
    nop
    sllv        v1,a0,a2
    or          v0,zero,zero
    jr          ra
    nop
lllshift1:
    or          v0,a0,zero
    sllv        v1,a1,a2
    beq         a2,zero,lllshift2
    nop
    srlv        t0,v0,t1
    sllv        v0,v0,a2
    or          v1,v1,t0
lllshift2:
    jr          ra
    nop
END(__ll_lshift)

LEAF(__ull_rshift)
    andi        a2,a2,0x3F
    ori         t1,zero,0x20
    subu        t1,t1,a2
    bgtz        t1,ullrshift1
    nop
    srlv        v0,a1,a2
    or          v1,zero,zero
    jr          ra
    nop
ullrshift1:
    or          v1,a1,zero
    srlv        v0,a0,a2
    beq         a2,zero,ullrshift2
    nop
    sllv        t0,a1,t1
    srlv        v1,a1,a2
    or          v0,v0,t0
ullrshift2:
    jr          ra
    nop
END(__ull_rshift)

#ifdef _NOFLOAT

LEAF(__ll_rshift)
    andi        a2,a2,0x3F
    ori         t1,zero,0x20
    subu        t1,t1,a2
    bgtz        t1,__ll_rshift_1
    nop
    srav        v0,a1,a2
    sra         v1,a1,0x1F
    jr          ra
    nop
__ll_rshift_1:
    or          v1,a1,zero
    srlv        v0,a0,a2
    beq         a2,zero,__ll_rshift_2
    nop
    sllv        t0,a1,t1
    srav        v1,a1,a2
    or          v0,v0,t0
__ll_rshift_2:
    jr          ra
    nop
END(__ll_rshift)

LEAF(__mice005)   //40149A28
    addiu       sp,sp,0xFFC8
    sw          ra,0x34(sp)
    sw          s8,0x10(sp)
    sw          s7,0x14(sp)
    sw          s6,0x18(sp)
    sw          s5,0x1C(sp)
    sw          s4,0x20(sp)
    sw          s3,0x24(sp)
    sw          s2,0x28(sp)
    sw          s1,0x2C(sp)
    sw          s0,0x30(sp)
    or          s6,a3,zero
    or          s4,a2,zero
    or          s1,a0,zero
    or          s0,a1,zero
    or          a0,s4,zero
    or          a1,s6,zero
    jal         mice005001
    sw          s1,0x38(sp)
    lw          s5,0x48(sp)
    lw          s7,0x4C(sp)
    or          a0,s5,zero
    or          a1,s7,zero
    jal         mice005001
    or          s8,v0,zero
    subu        s8,v0,s8
    blezl       s8,mice005002
    or          s3,zero,zero
    or          a2,s8,zero
    or          a1,s7,zero
    jal         __ll_lshift
    or          a0,s5,zero
    or          s5,v0,zero
    or          s7,v1,zero
    or          s3,zero,zero
mice005002:
    bltz        s8,mice005003
    or          s2,zero,zero
    addiu       s1,s8,1
    addiu       s8,zero,1
mice005008:
    or          a2,s8,zero
    or          a1,s2,zero
    jal         __ll_lshift
    or          a0,s3,zero
    or          s3,v0,zero
    bne         s7,s6,mice005004
    or          s2,v1,zero
    sltu        v0,s4,s5
    beql        zero,v0,mice005005
    sltu        v0,s4,s5
    b           mice005006
    or          a2,s8,zero
mice005004:
    sltu        v0,s7,s6
    beql        zero,v0,mice005006
    or          a2,s8,zero
    sltu        v0,s4,s5
mice005005:
    beql        zero,v0,mice005007
    or          v0,zero,zero
    b           mice005007
    or          v0,s8,zero
mice005007:
    subu        v0,s6,v0
    subu        s6,v0,s7
    subu        s4,s4,s5
    ori         s3,s3,1
    or          a2,s8,zero
mice005006:
    or          a1,s7,zero
    jal         __ull_rshift
    or          a0,s5,zero
    or          s5,v0,zero
    addiu       s1,s1,0xFFFF
    bne         zero,s1,mice005008
    or          s7,v1,zero
    lw          s1,0x38(sp)
mice005003:
    sw          s3,0(s1)
    sw          s2,4(s1)
    sw          s4,0(s0)
    sw          s6,4(s0)
    lw          s8,0x10(sp)
    lw          s7,0x14(sp)
    lw          s6,0x18(sp)
    lw          s5,0x1C(sp)
    lw          s4,0x20(sp)
    lw          s3,0x24(sp)
    lw          s2,0x28(sp)
    lw          s1,0x2C(sp)
    lw          s0,0x30(sp)
    lw          ra,0x34(sp)
    jr          ra
    addiu       sp,sp,0x38
mice005001:
    bne         zero,a1,mice005009
    or          v0,zero,zero
    beq         zero,a0,mice005010
    nop
    lui         v1,0x8000
    and         a3,a0,v1
    bne         zero,a3,mice005010
    addiu       v0,zero,0x20
mice005011:
    sll         a0,a0,1
    and         a3,a0,v1
    beq         zero,a3,mice005011
    addiu       v0,v0,1
    b           mice005010
    nop
mice005009:
    lui         v1,0x8000
    and         a3,a1,v1
    bne         zero,a3,mice005010
    nop
mice005012:
    sll         a1,a1,1
    and         a3,a1,v1
    beq         zero,a3,mice005012
    addiu       v0,v0,1
mice005010:
    jr          ra
    nop
END(__mice005)

LEAF(__dpadd)
    .set        noat
    addiu       sp,sp,0xFFD0
    sw          ra,0x28(sp)
    jal         __mice001
    nop
    and         t1,v1,a1
    sltiu       AT,t9,0x7FE
    beq         zero,AT,dpadd001
    nop
dpadd029:
    addiu       t9,t7,0xFFFF
    sltiu       AT,t9,0x7FE
    beq         zero,AT,dpadd002
    nop
dpadd031:
    subu        t9,t4,t7
    beq         zero,t9,dpadd003
    nop
    blez        t9,dpadd004
    nop
dpadd006:
    sltiu       AT,t9,0x20
    bne         zero,AT,dpadd005
    nop
    addi        t9,t9,0xFFE0
    sltu        a2,zero,t5
    or          t5,t6,a2
    beq         t6,zero,dpadd003
    nop
    ori         t6,zero,0
    b           dpadd006
    nop
dpadd005:
    beq         zero,t9,dpadd003
    nop
    sub         a0,zero,t9
    sllv        a2,t5,a0
    sllv        a0,t6,a0
    srlv        t5,t5,t9
    srlv        t6,t6,t9
    or          t5,a0,t5
    beq         zero,a2,dpadd003
    nop
    ori         t5,t5,2
    b           dpadd003
    nop
dpadd004:
    or          t4,t7,zero
    subu        t9,zero,t9
dpadd008:
    sltiu       AT,t9,0x20
    bne         zero,AT,dpadd007
    nop
    addi        t9,t9,0xFFE0
    sltu        a2,zero,t2
    or          t2,t3,a2
    beq         t3,zero,dpadd003
    nop
    ori         t3,zero,0
    b           dpadd008
    nop
dpadd007:
    beq         zero,t9,dpadd003
    nop
    sub         a0,zero,t9
    sllv        a2,t2,a0
    sllv        a0,t3,a0
    srlv        t2,t2,t9
    srlv        t3,t3,t9
    or          t2,a0,t2
    beq         zero,a2,dpadd003
    nop
    ori         t2,t2,2
dpadd003:
    xor         v0,a1,a3
    bltz        v0,dpadd009
    nop
    addu        t2,t2,t5
    sltu        v0,t2,t5
    addu        t3,t3,t6
    addu        t3,t3,v0
    beq         t6,t3,dpadd010
    nop
    sltu        v0,t3,t6
dpadd010:
    beq         zero,v0,dpadd011
    nop
    andi        v0,t2,1
    beq         zero,v0,dpadd012
    nop
    ori         t2,t2,2
dpadd012:
    srl         t2,t2,1
    sll         v0,t3,0x1F
    srl         t3,t3,1
    or          t2,t2,v0
    or          t3,t3,v1
    addiu       t4,t4,1
    b           dpadd011
    nop
dpadd009:
    sltu        v0,t2,t5
    subu        t2,t2,t5
    subu        t3,t3,v0
    addiu       AT,zero,0xFFFF
    beq         AT,t3,dpadd013
    nop
    sltu        v0,t3,t6
dpadd013:
    subu        t3,t3,t6
    beq         zero,v0,dpadd014
    nop
    xor         t1,t1,v1
    sltu        v0,zero,t2
    subu        t2,zero,t2
    subu        t3,zero,t3
    subu        t3,t3,v0
dpadd014:
    bne         zero,t3,dpadd015
    nop
    beq         zero,t2,dpadd016
    nop
    addiu       t4,t4,0xFFE0
    or          t3,t2,zero
    ori         t2,zero,0
    b           dpadd014
    nop
dpadd015:
    blez        t3,dpadd011
    nop
    slt         v0,t2,zero
    addu        t2,t2,t2
    addu        t3,t3,t3
    addu        t3,t3,v0
    addiu       t4,t4,0xFFFF
    b           dpadd015
    nop
dpadd011:
    jal         __mice002
    nop
dpadd025:
    bne         zero,t9,dpadd017
    nop
dpadd018:
    lw          ra,0x28(sp)
    addiu       sp,sp,0x30
    jr          ra
    nop
dpadd017:
    lw          a2,8(sp)
    lw          a3,0xC(sp)
    sw          a0,0x18(sp)
    sw          a1,0x1C(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,1
    jal         _exceptddd
    nop
    b           dpadd018
    nop
dpadd001:
    addu        t3,t3,t3
    beq         zero,t4,dpadd019
    nop
    sltu        t9,zero,t2
    or          t9,t9,t3
    beq         zero,t9,dpadd020
    nop
    lui         AT,7
    ori         AT,AT,0xFFFF
    and         a1,a1,AT
    bgtz        t9,dpadd021
    nop
    or          t9,a0,a1
    beq         zero,t9,dpadd022
    nop
    ori         AT,zero,0x7FF
    bne         AT,t7,dpadd022
    nop
    addu        t9,t6,t6
    sltu        t8,zero,t5
    or          t9,t9,t8
    bgtz        t9,dpadd023
    nop
dpadd022:
    lui         a1,0x7FF7
    ori         a1,a1,0xFFFF
    addiu       a0,zero,0xFFFF
    b           dpadd023
    nop
dpadd021:
    ori         AT,zero,0x7FF
    bne         AT,t7,dpadd024
    nop
    addu        t9,t6,t6
    sltu        t8,zero,t5
    or          t9,t9,t8
    bgez        t9,dpadd024
    nop
dpadd023:
    lui         AT,1
    or          t0,t0,AT
dpadd024:
    lui         AT,0x7FF0
    or          a1,a1,AT
dpadd026:
    jal         __mice003
    nop
    b           dpadd025
    nop
dpadd020:
    ori         AT,zero,0x7FF
    bne         AT,t7,dpadd026
    nop
    addu        t9,t6,t6
    or          t9,t9,t5
    bne         zero,t9,dpadd002
    nop
    bne         a3,a1,dpadd022
    nop
    b           dpadd026
    nop
dpadd019:
    or          v0,t3,t2
    beq         zero,v0,dpadd027
    nop
    srl         t3,t3,1
    addiu       t4,t4,1
    bne         zero,t3,dpadd028
    nop
    addiu       t4,t4,0xFFE0
    or          t3,t2,zero
    ori         t2,zero,0
dpadd028:
    blez        t3,dpadd029
    nop
    slt         v0,t2,zero
    addu        t2,t2,t2
    addu        t3,t3,t3
    addu        t3,t3,v0
    addiu       t4,t4,0xFFFF
    b           dpadd028
    nop
dpadd027:
    ori         AT,zero,0x7FF
    bne         AT,t7,dpadd029
    nop
dpadd002:
    addu        t6,t6,t6
    bne         zero,t7,dpadd030
    nop
    or          v0,t6,t5
    beq         zero,v0,dpadd031
    nop
    srl         t6,t6,1
    addiu       t7,t7,1
    bne         zero,t6,dpadd032
    nop
    addiu       t7,t7,0xFFE0
    or          t6,t5,zero
    ori         t5,zero,0
dpadd032:
    blez        t6,dpadd031
    nop
    slt         v0,t5,zero
    addu        t5,t5,t5
    addu        t6,t6,t6
    addu        t6,t6,v0
    addiu       t7,t7,0xFFFF
    b           dpadd032
    nop
dpadd030:
    or          v0,t6,t5
    beq         zero,v0,dpadd033
    nop
    bltz        t6,dpadd022
    nop
    lui         AT,0x7FFF
    ori         AT,AT,0xFFFF
    and         a3,a3,AT
dpadd033:
    or          a0,a2,zero
    or          a1,a3,zero
    b           dpadd026
    nop
dpadd016:
    sll         t8,t0,0x1E
    bltz        t8,dpadd034
    nop
    bgtz        t7,dpadd035
    nop
    sll         t9,a3,1
    or          t9,t9,a2
    bne         zero,t9,dpadd036
    nop
dpadd035:
    ori         t1,zero,0
    b           dpadd036
    nop
dpadd034:
    bltz        t7,dpadd036
    nop
    bne         zero,t7,dpadd037
    nop
    sll         t9,a3,0xC
    or          t9,t9,a2
    bne         zero,t9,dpadd036
    nop
dpadd037:
    sll         t1,t8,1
dpadd036:
    ori         a0,zero,0
    or          a1,t1,zero
    slti        AT,t7,0x3A
    beq         zero,AT,dpadd026
    nop
    blez        t7,dpadd026
    nop
    lui         AT,0x100
    and         t9,t0,AT
    beq         zero,t9,dpadd026
    nop
    ori         t0,t0,0x3000
    bgez        t8,dpadd026
    nop
    ori         t4,zero,1
    jal         __mice004
    nop
    b           dpadd025
    nop
    .set        at
END(__dpadd)

LEAF(__dpdiv)
    .set        noat
    addiu       sp,sp,0xFFD0
    sw          ra,0x28(sp)
    jal         __mice001
    nop
    xor         v0,a1,a3
    and         t1,v1,v0
    sltiu       AT,t9,0x7FE
    beq         zero,AT,dpdiv001
    nop
dpdiv039:
    addiu       t9,t7,0xFFFF
    sltiu       AT,t9,0x7FE
    beq         zero,AT,dpdiv002
    nop
dpdiv044:
    srl         t2,t2,1
    sll         t9,t3,0x1F
    srl         t3,t3,1
    or          t2,t2,t9
    srl         a0,t6,0x10
    divu        t3,a0
    bne         zero,a0,dpdiv003
    nop
    break 0
dpdiv003:
    mflo        t8
    nop
    nop
    mfhi        t3
    nop
    nop
    andi        v0,t6,0xFFFF
    multu       v0,t8
    mflo        v1
    nop
    nop
    sll         t3,t3,0x10
    srl         t9,t2,0x10
    or          t3,t3,t9
    sltu        t9,t3,v1
    subu        t3,t3,v1
    beq         zero,t9,dpdiv004
    nop
dpdiv005:
    addiu       t8,t8,0xFFFF
    addu        t3,t3,t6
    sltu        AT,t3,t6
    beq         zero,AT,dpdiv005
    nop
dpdiv004:
    divu        t3,a0
    bne         zero,a0,dpdiv006
    nop
    break 0
dpdiv006:
    mflo        a0
    nop
    nop
    mfhi        t3
    nop
    nop
    multu       v0,a0
    mflo        v1
    nop
    nop
    sll         t3,t3,0x10
    andi        t9,t2,0xFFFF
    or          t3,t3,t9
    sltu        t9,t3,v1
    subu        t3,t3,v1
    beq         zero,t9,dpdiv007
    nop
dpdiv008:
    addiu       a0,a0,0xFFFF
    addu        t3,t3,t6
    sltu        AT,t3,t6
    beq         zero,AT,dpdiv008
    nop
dpdiv007:
    sll         t8,t8,0x10
    addu        t8,t8,a0
    multu       t8,t5
    mflo        a0
    nop
    nop
    mfhi        v1
    nop
    nop
    ori         t2,zero,0
    sltu        t9,t2,a0
    subu        t2,t2,a0
    subu        t3,t3,t9
    addiu       AT,zero,0xFFFF
    beq         AT,t3,dpdiv009
    nop
    sltu        t9,t3,v1
dpdiv009:
    subu        t3,t3,v1
    beq         zero,t9,dpdiv010
    nop
dpdiv012:
    addiu       t8,t8,0xFFFF
    addu        t2,t2,t5
    sltu        t9,t2,t5
    addu        t3,t3,t6
    addu        t3,t3,t9
    beq         t6,t3,dpdiv011
    nop
    sltu        t9,t3,t6
dpdiv011:
    beq         zero,t9,dpdiv012
    nop
dpdiv010:
    bne         t6,t3,dpdiv013
    nop
    or          v1,t5,zero
    or          t3,t2,zero
    ori         v0,zero,0
    or          a0,v0,zero
    b           dpdiv014
    nop
dpdiv013:
    srl         a0,t6,0x10
    divu        t3,a0
    bne         zero,a0,dpdiv015
    nop
    break 0
dpdiv015:
    mflo        v0
    nop
    nop
    mfhi        t3
    nop
    nop
    andi        a2,t6,0xFFFF
    multu       a2,v0
    mflo        v1
    nop
    nop
    sll         t3,t3,0x10
    srl         t9,t2,0x10
    or          t3,t3,t9
    sltu        t9,t3,v1
    subu        t3,t3,v1
    beq         zero,t9,dpdiv016
    nop
dpdiv017:
    addiu       v0,v0,0xFFFF
    addu        t3,t3,t6
    sltu        AT,t3,t6
    beq         zero,AT,dpdiv017
    nop
dpdiv016:
    divu        t3,a0
    bne         zero,a0,dpdiv018
    nop
    break 0
dpdiv018:
    mflo        a0
    nop
    nop
    mfhi        t3
    nop
    nop
    multu       a2,a0
    mflo        v1
    nop
    nop
    sll         t3,t3,0x10
    andi        t9,t2,0xFFFF
    or          t3,t3,t9
    sltu        t9,t3,v1
    subu        t3,t3,v1
    beq         zero,t9,dpdiv019
    nop
dpdiv020:
    addiu       a0,a0,0xFFFF
    addu        t3,t3,t6
    sltu        AT,t3,t6
    beq         zero,AT,dpdiv020
    nop
dpdiv019:
    sll         v0,v0,0x10
    addu        v0,v0,a0
    multu       v0,t5
    mflo        a0
    nop
    nop
    mfhi        v1
    nop
    nop
dpdiv014:
    ori         t2,zero,0
    sltu        t9,t2,a0
    subu        t2,t2,a0
    subu        t3,t3,t9
    addiu       AT,zero,0xFFFF
    beq         AT,t3,dpdiv021
    nop
    sltu        t9,t3,v1
dpdiv021:
    subu        t3,t3,v1
    beq         zero,t9,dpdiv022
    nop
dpdiv024:
    addiu       v0,v0,0xFFFF
    addu        t2,t2,t5
    sltu        t9,t2,t5
    addu        t3,t3,t6
    addu        t3,t3,t9
    beq         t6,t3,dpdiv023
    nop
    sltu        t9,t3,t6
dpdiv023:
    beq         zero,t9,dpdiv024
    nop
dpdiv022:
    subu        t4,t4,t7
    addiu       t4,t4,0x3FF
    bltz        t8,dpdiv025
    nop
    slt         t9,v0,zero
    addu        v0,v0,v0
    addu        t8,t8,t8
    addu        t8,t8,t9
    addiu       t4,t4,0xFFFF
dpdiv025:
    or          t9,t3,t2
    beq         zero,t9,dpdiv026
    nop
    ori         v0,v0,1
dpdiv026:
    or          t3,t8,zero
    or          t2,v0,zero
    jal         __mice002
    nop
dpdiv036:
    bne         zero,t9,dpdiv027
    nop
dpdiv028:
    lw          ra,0x28(sp)
    addiu       sp,sp,0x30
    jr          ra
    nop
dpdiv027:
    lw          a2,8(sp)
    lw          a3,0xC(sp)
    sw          a0,0x18(sp)
    sw          a1,0x1C(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,4
    jal         _exceptddd
    nop
    b           dpdiv028
    nop
dpdiv001:
    addu        t3,t3,t3
    beq         zero,t4,dpdiv029
    nop
    sltu        t9,zero,t2
    or          t9,t9,t3
    bne         zero,t9,dpdiv030
    nop
    ori         AT,zero,0x7FF
    bne         AT,t7,dpdiv031
    nop
    addu        t9,t6,t6
    or          t9,t9,t5
    bne         zero,t9,dpdiv002
    nop
    b           dpdiv032
    nop
dpdiv030:
    lui         AT,7
    ori         AT,AT,0xFFFF
    and         a1,a1,AT
    bgtz        t9,dpdiv033
    nop
    or          t9,a0,a1
    beq         zero,t9,dpdiv032
    nop
    ori         AT,zero,0x7FF
    bne         AT,t7,dpdiv032
    nop
    addu        t9,t6,t6
    sltu        t8,zero,t5
    or          t9,t9,t8
    bgtz        t9,dpdiv034
    nop
dpdiv032:
    lui         a1,0x7FF7
    ori         a1,a1,0xFFFF
    addiu       a0,zero,0xFFFF
    b           dpdiv034
    nop
dpdiv033:
    ori         AT,zero,0x7FF
    bne         AT,t7,dpdiv035
    nop
    addu        t9,t6,t6
    sltu        t8,zero,t5
    or          t9,t9,t8
    bgez        t9,dpdiv035
    nop
dpdiv034:
    lui         AT,1
    or          t0,t0,AT
dpdiv035:
    lui         AT,0x7FF0
    or          a1,a1,AT
dpdiv042:
    jal         __mice003
    nop
    b           dpdiv036
    nop
dpdiv031:
    jal         __mice004
    nop
    b           dpdiv036
    nop
dpdiv029:
    or          v0,t3,t2
    beq         zero,v0,dpdiv037
    nop
    srl         t3,t3,1
    addiu       t4,t4,1
    bne         zero,t3,dpdiv038
    nop
    addiu       t4,t4,0xFFE0
    or          t3,t2,zero
    ori         t2,zero,0
dpdiv038:
    blez        t3,dpdiv039
    nop
    slt         v0,t2,zero
    addu        t2,t2,t2
    addu        t3,t3,t3
    addu        t3,t3,v0
    addiu       t4,t4,0xFFFF
    b           dpdiv038
    nop
dpdiv037:
    addu        t9,a3,a3
    or          t9,t9,a2
    beq         zero,t9,dpdiv032
    nop
    ori         AT,zero,0x7FF
    bne         AT,t7,dpdiv031
    nop
dpdiv002:
    addu        t6,t6,t6
    bne         zero,t7,dpdiv040
    nop
    or          v0,t6,t5
    bne         zero,v0,dpdiv041
    nop
    ori         t0,t0,0x8000
    lui         AT,0x7FF0
    or          a1,t1,AT
    ori         a0,zero,0
    b           dpdiv042
    nop
dpdiv041:
    srl         t6,t6,1
    addiu       t7,t7,1
    bne         zero,t6,dpdiv043
    nop
    addiu       t7,t7,0xFFE0
    or          t6,t5,zero
    ori         t5,zero,0
dpdiv043:
    blez        t6,dpdiv044
    nop
    slt         v0,t5,zero
    addu        t5,t5,t5
    addu        t6,t6,t6
    addu        t6,t6,v0
    addiu       t7,t7,0xFFFF
    b           dpdiv043
    nop
dpdiv040:
    or          v0,t6,t5
    bne         zero,v0,dpdiv045
    nop
    or          a1,t1,zero
    ori         a0,zero,0
    b           dpdiv042
    nop
dpdiv045:
    bltz        t6,dpdiv032
    nop
    lui         AT,0x7FFF
    ori         AT,AT,0xFFFF
    and         a3,a3,AT
    or          v0,t6,t5
    bne         zero,v0,dpdiv046
    nop
    lui         AT,0x7FF0
    or          a3,t1,AT
dpdiv046:
    or          a0,a2,zero
    or          a1,a3,zero
    b           dpdiv042
    nop
    .set        at
END(__dpdiv)

LEAF(__dpsub)
    .set        noat
    lui         AT,0x8000
    xor         a3,a3,AT
    j           __dpadd
    nop
    .set        at
END(__dpsub)

LEAF(__ged)
    .set        noat
    addiu       sp,sp,0xFFD8
    sw          ra,0x20(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x24(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,0x28(sp)
    sw          a1,0x2C(sp)
    sw          a2,0x30(sp)
    sw          a3,0x34(sp)
    sll         t2,a1,1
    sll         t3,a3,1
    or          t3,t3,a0
    or          t3,t3,a2
    or          t2,t2,t3
    beq         zero,t2,ged001
    nop
    sll         t0,a1,1
    beq         zero,a0,ged002
    nop
    ori         t0,t0,1
ged002:
    sll         t1,a3,1
    beq         zero,a2,ged003
    nop
    ori         t1,t1,1
ged003:
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t0,AT
    beq         zero,AT,ged004
    nop
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t1,AT
    beq         zero,AT,ged004
    nop
    bgez        a1,ged005
    nop
    bgez        a3,ged006
    nop
    sltu        t2,a0,a2
    subu        a0,a0,a2
    subu        a1,a1,t2
    addiu       AT,zero,0xFFFF
    beq         AT,a1,ged007
    nop
    sltu        t2,a1,a3
ged007:
    subu        a1,a1,a3
    bne         zero,t2,ged008
    nop
    or          t2,a1,a0
    bne         zero,t2,ged006
    nop
    b           ged001
    nop
ged005:
    bltz        a3,ged008
    nop
    sltu        t2,a0,a2
    subu        a0,a0,a2
    subu        a1,a1,t2
    addiu       AT,zero,0xFFFF
    beq         AT,a1,ged009
    nop
    sltu        t2,a1,a3
ged009:
    subu        a1,a1,a3
    beq         zero,t2,ged010
    nop
ged006:
    ori         v0,zero,0
    b           ged011
    nop
ged010:
    or          t2,a1,a0
    beq         zero,t2,ged001
    nop
ged008:
    ori         v0,zero,1
    b           ged011
    nop
ged001:
    ori         v0,zero,1
ged011:
    addiu       sp,sp,0x28
    jr          ra
    nop
ged004:
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    ori         a0,zero,0
    lw          a2,0x28(sp)
    lw          a3,0x2C(sp)
    lw          t0,0x30(sp)
    lw          t1,0x34(sp)
    lw          t4,0x24(sp)
    sw          t0,0x10(sp)
    sw          t1,0x14(sp)
    sw          a0,0x18(sp)
    sw          t4,0x1C(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,7
    jal         _exceptldd
    nop
    lw          v0,0x18(sp)
    lw          ra,0x20(sp)
    b           ged011
    nop
    .set        at
END(__ged)

LEAF(__led)
    .set        noat
    addiu       sp,sp,0xFFD8
    sw          ra,0x20(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x24(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,0x28(sp)
    sw          a1,0x2C(sp)
    sw          a2,0x30(sp)
    sw          a3,0x34(sp)
    sll         t2,a1,1
    sll         t3,a3,1
    or          t3,t3,a0
    or          t3,t3,a2
    or          t2,t2,t3
    beq         zero,t2,led001
    nop
    sll         t0,a1,1
    beq         zero,a0,led002
    nop
    ori         t0,t0,1
led002:
    sll         t1,a3,1
    beq         zero,a2,led003
    nop
    ori         t1,t1,1
led003:
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t0,AT
    beq         zero,AT,led004
    nop
    lui         AT,0xFFE0
    ori         AT,AT,1
    sltu        AT,t1,AT
    beq         zero,AT,led004
    nop
    bgez        a1,led005
    nop
    bgez        a3,led006
    nop
    sltu        t2,a0,a2
    subu        a0,a0,a2
    subu        a1,a1,t2
    addiu       AT,zero,0xFFFF
    beq         AT,a1,led007
    nop
    sltu        t2,a1,a3
led007:
    subu        a1,a1,a3
    bne         zero,t2,led008
    nop
    or          t2,a1,a0
    bne         zero,t2,led006
    nop
    b           led001
    nop
led005:
    bltz        a3,led008
    nop
    sltu        t2,a0,a2
    subu        a0,a0,a2
    subu        a1,a1,t2
    addiu       AT,zero,0xFFFF
    beq         AT,a1,led009
    nop
    sltu        t2,a1,a3
led009:
    subu        a1,a1,a3
    beq         zero,t2,led010
    nop
led006:
    ori         v0,zero,1
    b           led011
    nop
led010:
    or          t2,a1,a0
    beq         zero,t2,led001
    nop
led008:
    ori         v0,zero,0
    b           led011
    nop
led001:
    ori         v0,zero,1
led011:
    addiu       sp,sp,0x28
    jr          ra
    nop
led004:
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    ori         a0,zero,0
    lw          a2,0x28(sp)
    lw          a3,0x2C(sp)
    lw          t0,0x30(sp)
    lw          t1,0x34(sp)
    lw          t4,0x24(sp)
    sw          t0,0x10(sp)
    sw          t1,0x14(sp)
    sw          a0,0x18(sp)
    sw          t4,0x1C(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,7
    jal         _exceptldd
    nop
    lw          v0,0x18(sp)
    lw          ra,0x20(sp)
    b           led011
    nop
    .set        at
END(__led)

LEAF(__ultodp)
    .set        noat
    addiu       sp,sp,0xFFE8
    ori         a3,zero,0x41E
    ori         a1,zero,0
    or          a2,a0,zero
    bne         zero,a2,ultodp001
    nop
    ori         a3,zero,0
    b           ultodp002
    nop
ultodp001:
    blez        a2,ultodp002
    nop
    addu        a2,a2,a2
    addiu       a3,a3,0xFFFF
    b           ultodp001
    nop
ultodp002:
    srl         t0,a1,0xB
    sll         t2,a2,0x15
    or          t0,t0,t2
    sll         t1,a2,1
    srl         t1,t1,0xC
    sll         t2,a3,0x14
    or          t1,t1,t2
    or          v0,t0,zero
    or          v1,t1,zero
    addiu       sp,sp,0x18
    jr          ra
    nop
    .set        at
END(__ultodp)

#endif

LEAF(__ull_div)
    addiu       sp,sp,0xFFD0
    sw          ra,0x28(sp)
    or          v0,a3,zero
    or          v1,a2,zero
    or          a3,a1,zero
    bne         zero,v0,__ull_div_1
    or          a2,a0,zero
    lui         a1,1
    sltu        a1,v1,a1
    beql        zero,a1,__ull_div_2
    addiu       a1,sp,0x20
    addiu       a1,sp,0x20
    addiu       a0,sp,0x18
    sw          v0,0x14(sp)
    jal         __ull_divrem_6416
    sw          v1,0x10(sp)
    b           __ull_div_3
    nop
__ull_div_1:
    addiu       a1,sp,0x20
__ull_div_2:
    addiu       a0,sp,0x18
    sw          v1,0x10(sp)
    jal         __ll_div_9
    sw          v0,0x14(sp)
__ull_div_3:
    lw          v0,0x18(sp)
    lw          v1,0x1C(sp)
    lw          ra,0x28(sp)
    jr          ra
    addiu       sp,sp,0x30
END(__ull_div)

LEAF(__ull_rem)
    addiu       sp,sp,0xFFD0
    sw          ra,0x28(sp)
    or          v0,a3,zero
    or          v1,a2,zero
    or          a3,a1,zero
    bne         zero,v0,__ull_rem_1
    or          a2,a0,zero
    lui         a1,1
    sltu        a1,v1,a1
    beql        zero,a1,__ull_rem_2
    addiu       a1,sp,0x18
    addiu       a1,sp,0x18
    addiu       a0,sp,0x20
    sw          v0,0x14(sp)
    jal         __ull_divrem_6416
    sw          v1,0x10(sp)
    b           __ull_rem_3
    nop
__ull_rem_1:
    addiu       a1,sp,0x18
__ull_rem_2:
    addiu       a0,sp,0x20
    sw          v1,0x10(sp)
    jal         __ll_div_9
    sw          v0,0x14(sp)
__ull_rem_3:
    lw          v0,0x18(sp)
    lw          v1,0x1C(sp)
    lw          ra,0x28(sp)
    jr          ra
    addiu       sp,sp,0x30
END(__ull_rem)

#ifdef _NOFLOAT

LEAF(__litofp)
    .set        noat
    addiu       sp,sp,0xFFE8
    lui         AT,0x8000
    and         a2,a0,AT
    beq         zero,a0,litofp001
    nop
    bgez        a0,litofp002
    nop
    subu        a0,zero,a0
litofp002:
    ori         a1,zero,0x9E
litofp004:
    blez        a0,litofp003
    nop
    addu        a0,a0,a0
    addiu       a1,a1,0xFFFF
    b           litofp004
    nop
litofp003:
    la          AT,_fsr
    lw          a3,0(AT)
    andi        t9,a0,0xFF
    bne         zero,t9,litofp005
    nop
    andi        t9,a3,0x100
    beq         zero,t9,litofp006
    nop
    b           litofp007
    nop
litofp005:
    ori         a3,a3,0x1004
    andi        t9,a0,0x17F
    beq         zero,t9,litofp007
    nop
    addiu       a0,a0,0x80
    sltiu       t9,a0,0x80
    addu        a1,a1,t9
litofp007:
    bgtz        a1,litofp006
    nop
    ori         a3,a3,0x2008
litofp006:
    sltiu       AT,a1,0xFF
    bne         zero,AT,litofp008
    nop
    ori         a3,a3,0x4010
    addi        a1,a1,0xFF40
    andi        t9,a3,0x200
    beq         zero,t9,litofp009
    nop
    sltiu       AT,a1,0xFF
    bne         zero,AT,litofp008
    nop
litofp009:
    ori         a1,zero,0xFF
    ori         a0,zero,0
litofp008:
    la          AT,_fsr
    sw          a3,0(AT)
    sll         a0,a0,1
    srl         a0,a0,9
    sll         t1,a1,0x17
    or          a0,a0,t1
litofp001:
    or          v0,a0,a2
    addiu       sp,sp,0x18
    jr          ra
    nop
    .set        at
END(__litofp)

LEAF(__fptoli)
    .set        noat
    addiu       sp,sp,0xFFE8
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x14(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,4(sp)
    srl         a2,a0,0x17
    andi        a2,a2,0xFF
    sll         a1,a0,8
    lui         AT,0x8000
    or          a1,a1,AT
    slti        AT,a2,0x9E
    beq         zero,AT,fptoli001
    nop
    ori         t0,zero,0x9E
    subu        a2,t0,a2
    slti        AT,a2,0x20
    bne         zero,AT,fptoli002
    nop
    or          a3,a1,zero
    ori         AT,zero,0x9E
    bne         AT,a2,fptoli003
    nop
    sll         a3,a3,1
    sra         a3,a3,1
fptoli003:
    ori         a1,zero,0
    b           fptoli004
    nop
fptoli002:
    ori         t0,zero,0x20
    subu        t0,t0,a2
    sllv        a3,a1,t0
    srlv        a1,a1,a2
fptoli004:
    bgez        a0,fptoli005
    nop
    subu        a1,zero,a1
fptoli005:
    or          v0,a1,zero
fptoli006:
    addiu       sp,sp,0x18
    jr          ra
    nop
fptoli001:
    lui         AT,0xCF00
    beq         AT,a0,fptoli005
    nop
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    lui         a0,0x7FFF
    ori         a0,a0,0xFFFF
    lw          a2,4(sp)
    or          a3,a0,zero
    lw          t2,0x14(sp)
    sw          ra,0(sp)
    addi        sp,sp,0xFFC0
    sw          t2,0x10(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,8
    jal         _exceptlf
    nop
    addi        sp,sp,0x40
    lw          ra,0(sp)
    b           fptoli006
    nop
    .set        at
END(__fptoli)

LEAF(_exceptlf)
    addiu       sp,sp,0xFFC0
    sw          ra,0x38(sp)
    sw          s8,0x28(sp)
    sw          s7,0x2C(sp)
    sw          s6,0x30(sp)
    sw          s5,0x34(sp)
    or          s6,a0,zero
    or          a0,a3,zero
    or          s8,a2,zero
    jal         __litodp
    or          s7,a1,zero
    or          a0,s8,zero
    sw          v0,0x24(sp)
    jal         __fptodp
    sw          v1,0x20(sp)
    lw          t1,0x20(sp)
    or          a2,v0,zero
    sw          t1,0x14(sp)
    lw          v0,0x50(sp)
    lw          t1,0x24(sp)
    or          a3,v1,zero
    or          a1,s7,zero
    or          a0,s6,zero
    sw          v0,0x18(sp)
    jal         _except1
    sw          t1,0x10(sp)
    or          a1,zero,zero
    or          a0,zero,zero
    or          s6,v1,zero
    jal         _controlfp
    or          s7,v0,zero
    lui         s8,8
    ori         s8,s8,0x1F
    or          a1,s8,zero
    or          a0,s8,zero
    jal         _controlfp
    or          s5,v0,zero
    or          a1,s8,zero
    jal         _controlfp
    or          a0,s5,zero
    or          a1,s6,zero
    jal         __dptoli
    or          a0,s7,zero
    lw          s8,0x28(sp)
    lw          s7,0x2C(sp)
    lw          s6,0x30(sp)
    lw          s5,0x34(sp)
    lw          ra,0x38(sp)
    jr          ra
    addiu       sp,sp,0x40
END(_exceptlf)

LEAF(__ultofp)
    .set        noat
    addiu       sp,sp,0xFFE8
    beq         zero,a0,ultofp001
    nop
    ori         a2,zero,0x9E
ultofp003:
    blez        a0,ultofp002
    nop
    addu        a0,a0,a0
    addiu       a2,a2,0xFFFF
    b           ultofp003
    nop
ultofp002:
    la          AT,_fsr
    lw          a1,0(AT)
    andi        t9,a0,0xFF
    bne         zero,t9,ultofp004
    nop
    andi        t9,a1,0x100
    beq         zero,t9,ultofp005
    nop
    b           ultofp006
    nop
ultofp004:
    ori         a1,a1,0x1004
    andi        t9,a0,0x17F
    beq         zero,t9,ultofp006
    nop
    addiu       a0,a0,0x80
    sltiu       t9,a0,0x80
    addu        a2,a2,t9
ultofp006:
    bgtz        a2,ultofp005
    nop
    ori         a1,a1,0x2008
ultofp005:
    sltiu       AT,a2,0xFF
    bne         zero,AT,ultofp007
    nop
    ori         a1,a1,0x4010
    addi        a2,a2,0xFF40
    andi        t9,a1,0x200
    beq         zero,t9,ultofp008
    nop
    sltiu       AT,a2,0xFF
    bne         zero,AT,ultofp007
    nop
ultofp008:
    ori         a2,zero,0xFF
    ori         a0,zero,0
ultofp007:
    la          AT,_fsr
    sw          a1,0(AT)
    sll         a0,a0,1
    srl         a0,a0,9
    sll         a3,a2,0x17
    or          a0,a0,a3
ultofp001:
    or          v0,a0,zero
    addiu       sp,sp,0x18
    jr          ra
    nop
    .set        at
END(__ultofp)

LEAF(__fptoul)
    .set        noat
    addiu       sp,sp,0xFFE8
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x14(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,4(sp)
    srl         a2,a0,0x17
    andi        a2,a2,0xFF
    sll         a1,a0,8
    lui         AT,0x8000
    or          a1,a1,AT
    slti        AT,a2,0x9F
    beq         zero,AT,fptoul001
    nop
    ori         t0,zero,0x9E
    subu        a2,t0,a2
    slti        AT,a2,0x20
    bne         zero,AT,fptoul002
    nop
    or          a3,a1,zero
    ori         AT,zero,0x9E
    bne         AT,a2,fptoul003
    nop
    sll         a3,a3,1
    sra         a3,a3,1
fptoul003:
    ori         a1,zero,0
    b           fptoul004
    nop
fptoul002:
    ori         t0,zero,0x20
    subu        t0,t0,a2
    sllv        a3,a1,t0
    srlv        a1,a1,a2
fptoul004:
    bgez        a0,fptoul005
    nop
    subu        a1,zero,a1
fptoul005:
    or          v0,a1,zero
fptoul006:
    addiu       sp,sp,0x18
    jr          ra
    nop
fptoul001:
    lui         AT,0xCF00
    beq         AT,a0,fptoul005
    nop
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    addiu       a0,zero,0xFFFF
    lw          a2,4(sp)
    or          a3,a0,zero
    lw          t2,0x14(sp)
    sw          ra,0(sp)
    addi        sp,sp,0xFFC0
    sw          t2,0x10(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,8
    jal         _exceptuf
    nop
    addi        sp,sp,0x40
    lw          ra,0(sp)
    b           fptoul006
    nop
    .set        at
END(__fptoul)

LEAF(_exceptuf)
    addiu       sp,sp,0xFFC0
    sw          ra,0x38(sp)
    sw          s8,0x28(sp)
    sw          s7,0x2C(sp)
    sw          s6,0x30(sp)
    sw          s5,0x34(sp)
    or          s6,a0,zero
    or          a0,a3,zero
    or          s8,a2,zero
    jal         __ultodp
    or          s7,a1,zero
    or          a0,s8,zero
    sw          v0,0x24(sp)
    jal         __fptodp
    sw          v1,0x20(sp)
    lw          t1,0x20(sp)
    or          a2,v0,zero
    sw          t1,0x14(sp)
    lw          v0,0x50(sp)
    lw          t1,0x24(sp)
    or          a3,v1,zero
    or          a1,s7,zero
    or          a0,s6,zero
    sw          v0,0x18(sp)
    jal         _except1
    sw          t1,0x10(sp)
    or          a1,zero,zero
    or          a0,zero,zero
    or          s6,v1,zero
    jal         _controlfp
    or          s7,v0,zero
    lui         s8,8
    ori         s8,s8,0x1F
    or          a1,s8,zero
    or          a0,s8,zero
    jal         _controlfp
    or          s5,v0,zero
    or          a1,s8,zero
    jal         _controlfp
    or          a0,s5,zero
    or          a1,s6,zero
    jal         __dptoli
    or          a0,s7,zero
    lw          s8,0x28(sp)
    lw          s7,0x2C(sp)
    lw          s6,0x30(sp)
    lw          s5,0x34(sp)
    lw          ra,0x38(sp)
    jr          ra
    addiu       sp,sp,0x40
END(_exceptuf)

LEAF(__dptoul)
    .set        noat
    addiu       sp,sp,0xFFE0
    sw          ra,0x18(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x14(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,8(sp)
    sw          a1,0xC(sp)
    sll         t3,a1,1
    srl         t3,t3,0x15
    sll         t2,a1,0xB
    srl         t4,a0,0x15
    or          t2,t2,t4
    sll         t1,a0,0xB
    lui         AT,0x8000
    or          t2,t2,AT
    sltiu       AT,t3,0x41F
    beq         zero,AT,dptoul001
    nop
    ori         a2,zero,0x41E
    subu        a2,a2,t3
dptoul004:
    sltiu       AT,a2,0x20
    bne         zero,AT,dptoul002
    nop
    addi        a2,a2,0xFFE0
    sltu        t0,zero,t1
    or          t1,t2,t0
    beq         t2,zero,dptoul003
    nop
    ori         t2,zero,0
    b           dptoul004
    nop
dptoul002:
    beq         zero,a2,dptoul003
    nop
    sub         a3,zero,a2
    sllv        t0,t1,a3
    sllv        a3,t2,a3
    srlv        t1,t1,a2
    srlv        t2,t2,a2
    or          t1,a3,t1
    beq         zero,t0,dptoul003
    nop
    ori         t1,t1,2
dptoul003:
    bgez        a1,dptoul005
    nop
    ori         t2,zero,0
dptoul005:
    or          v0,t2,zero
dptoul007:
    addiu       sp,sp,0x20
    jr          ra
    nop
dptoul001:
    lui         AT,0xC1E0
    bne         AT,a1,dptoul006
    nop
    beq         zero,a0,dptoul005
    nop
dptoul006:
    addiu       a0,zero,0xFFFF
    lw          a2,8(sp)
    lw          a3,0xC(sp)
    sw          a0,0x10(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,8
    jal         _exceptud
    nop
    lw          v0,0x10(sp)
    lw          ra,0x18(sp)
    b           dptoul007
    nop
    .set        at
END(__dptoul)

LEAF(__fpmul)
    .set        noat
    addiu       sp,sp,0xFFE0
    sw          ra,0x18(sp)
    jal         __mice006
    nop
    xor         t1,a0,a1
    and         t1,t1,v1
    sltiu       AT,t9,0xFE
    beq         zero,AT,fpmul001
    nop
fpmul018:
    addiu       t9,t7,0xFFFF
    sltiu       AT,t9,0xFE
    beq         zero,AT,fpmul002
    nop
fpmul023:
    multu       t3,t6
    mflo        t2
    nop
    nop
    mfhi        t3
    nop
    nop
    addiu       v0,t7,0xFF82
    addu        t4,t4,v0
    blez        t3,fpmul003
    nop
    addiu       t4,t4,0xFFFF
    sll         t3,t3,1
fpmul003:
    beq         zero,t2,fpmul004
    nop
    ori         t3,t3,1
fpmul004:
    andi        t9,t3,0xFF
    beq         zero,t9,fpmul005
    nop
    ori         t0,t0,0x1000
fpmul005:
    jal         __mice007
    nop
fpmul014:
    bne         zero,t9,fpmul006
    nop
fpmul007:
    lw          ra,0x18(sp)
    addiu       sp,sp,0x20
    jr          ra
    nop
fpmul006:
    lw          a2,8(sp)
    lw          a3,0xC(sp)
    sw          a0,0x10(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,3
    jal         _exceptfff
    nop
    b           fpmul007
    nop
fpmul001:
    addu        t3,t3,t3
    beq         zero,t4,fpmul008
    nop
    beq         zero,t3,fpmul009
    nop
    lui         AT,0x3F
    ori         AT,AT,0xFFFF
    and         a0,a0,AT
    bgtz        t3,fpmul010
    nop
    beq         zero,a0,fpmul011
    nop
    ori         AT,zero,0xFF
    bne         AT,t7,fpmul011
    nop
    addu        t9,t6,t6
    bgtz        t9,fpmul012
    nop
fpmul011:
    lui         a0,0x7FBF
    ori         a0,a0,0xFFFF
    b           fpmul012
    nop
fpmul010:
    ori         AT,zero,0xFF
    bne         AT,t7,fpmul013
    nop
    addu        t9,t6,t6
    bgez        t9,fpmul013
    nop
fpmul012:
    lui         AT,1
    or          t0,t0,AT
fpmul013:
    lui         AT,0x7F80
    or          a0,a0,AT
fpmul021:
    jal         __mice008
    nop
    b           fpmul014
    nop
fpmul009:
    addu        t9,t6,t6
    ori         AT,zero,0xFF
    bne         AT,t7,fpmul015
    nop
    bne         zero,t9,fpmul002
    nop
fpmul016:
    jal         __mice009
    nop
    b           fpmul014
    nop
fpmul015:
    bne         zero,t7,fpmul016
    nop
    beq         zero,t9,fpmul011
    nop
    b           fpmul016
    nop
fpmul008:
    beq         zero,t3,fpmul017
    nop
fpmul019:
    blez        t3,fpmul018
    nop
    addu        t3,t3,t3
    addiu       t4,t4,0xFFFF
    b           fpmul019
    nop
fpmul017:
    ori         AT,zero,0xFF
    bne         AT,t7,fpmul020
    nop
    addu        t9,t6,t6
    bne         zero,t9,fpmul002
    nop
    b           fpmul011
    nop
fpmul020:
    or          a0,t1,zero
    b           fpmul021
    nop
fpmul002:
    addu        t6,t6,t6
    bne         zero,t7,fpmul022
    nop
    beq         zero,t6,fpmul020
    nop
fpmul024:
    blez        t6,fpmul023
    nop
    addu        t6,t6,t6
    addiu       t7,t7,0xFFFF
    b           fpmul024
    nop
fpmul022:
    bltz        t6,fpmul011
    nop
    lui         AT,0x7FFF
    ori         AT,AT,0xFFFF
    and         a0,a1,AT
    bne         zero,t6,fpmul021
    nop
    lui         AT,0x7F80
    or          a0,t1,AT
    b           fpmul021
    nop
    .set        at
END(__fpmul)

LEAF(__mice006)     //40148078
    .set        noat
    la          AT,_fsr
    lw          t0,0(AT)
    xori        t8,t0,0xF80
    sw          t8,0x14(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t0,t0,t8
    sw          a0,8(sp)
    sw          a1,0xC(sp)
    srl         t4,a0,0x17
    andi        t4,t4,0xFF
    srl         t7,a1,0x17
    andi        t7,t7,0xFF
    lui         v1,0x8000
    sll         t3,a0,8
    or          t3,t3,v1
    sll         t6,a1,8
    or          t6,t6,v1
    addiu       t9,t4,0xFFFF
    jr          ra
    nop
    .set        at
END(__mice006)

LEAF(__mice007)     //401480D0
    .set        noat
    andi        t9,t3,0xFF
    beq         zero,t9,mice007001
    nop
    ori         t0,t0,0x1000
    andi        t9,t0,3
    ori         AT,zero,1
    beq         AT,t9,mice007001
    nop
    ori         v0,zero,0x80
    beq         zero,t9,mice007002
    nop
    sll         t9,t9,0x1F
    xor         t9,t9,t1
    bne         zero,t9,mice007001
    nop
    ori         v0,zero,0x100
mice007002:
    nor         t9,v0,zero
    andi        t9,t9,0x1FF
    and         t9,t9,t3
    beq         zero,t9,mice007001
    nop
    addu        t3,t3,v0
    sltu        t9,t3,v0
    addu        t4,t4,t9
mice007001:
    blez        t4,mice007003
    nop
mice007006:
    sltiu       AT,t4,0xFF
    beq         zero,AT,mice007004
    nop
mice007008:
    sll         t3,t3,1
    srl         t3,t3,9
    sll         v0,t4,0x17
    or          t3,t3,v0
    or          a0,t3,t1
    srl         t9,t0,5
    andi        t9,t9,0xF80
    srl         t8,t9,5
    or          t0,t0,t8
    la          AT,_fsr
    sw          t0,0(AT)
    and         t9,t9,t0
    or          v0,a0,zero
    jr          ra
    nop
mice007003:
    bne         zero,t4,mice007005
    nop
    beq         zero,t3,mice007006
    nop
mice007005:
    andi        t9,t0,0x100
    beq         zero,t9,mice007007
    nop
    addiu       t4,t4,0xC0
    ori         t0,t0,0x3000
    b           mice007008
    nop
mice007007:
    ori         t9,zero,1
    subu        t9,t9,t4
    ori         v0,zero,0x20
    subu        v0,v0,t9
    sllv        t8,t3,v0
    srlv        t3,t3,t9
    sltiu       AT,t9,0x20
    bne         zero,AT,mice007009
    nop
    or          t8,t8,t3
    ori         t3,zero,0
mice007009:
    andi        v0,t3,0xFF
    or          t8,t8,v0
    beq         zero,t8,mice007010
    nop
    ori         t0,t0,0x1000
mice007010:
    lui         AT,0x100
    and         t9,t0,AT
    beq         zero,t9,mice007011
    nop
    ori         t3,zero,0
    ori         t4,zero,0
    lui         AT,0x7F80
    and         t9,a0,AT
    beq         zero,t9,mice007012
    nop
    lui         AT,0x7F80
    and         t9,a1,AT
    bne         zero,t9,mice007013
    nop
mice007012:
    ori         t1,zero,0
    addiu       AT,zero,0xEFFF
    and         t0,t0,AT
    b           mice007006
    nop
mice007013:
    ori         t0,t0,0x3000
    andi        t9,t0,3
    slti        AT,t9,2
    bne         zero,AT,mice007006
    nop
    sll         t9,t9,0x1F
    xor         t9,t9,t1
    bne         zero,t9,mice007006
    nop
    ori         t4,zero,1
    b           mice007006
    nop
mice007011:
    ori         t4,zero,0
    bne         zero,t8,mice007014
    nop
    lui         AT,0x7F80
    and         t9,a0,AT
    beq         zero,t9,mice007006
    nop
    lui         AT,0x7F80
    and         t9,a1,AT
    beq         zero,t9,mice007006
    nop
    andi        t9,t0,0x1000
    beq         zero,t9,mice007006
    nop
mice007014:
    ori         t0,t0,0x3000
    b           mice007006
    nop
mice007004:
    ori         t0,t0,0x5000
    addi        t4,t4,0xFF40
    andi        t9,t0,0x200
    beq         zero,t9,mice007015
    nop
    sltiu       AT,t4,0xFF
    bne         zero,AT,mice007008
    nop
mice007015:
    ori         t4,zero,0xFF
    ori         t3,zero,0
    andi        t9,t0,3
    slti        AT,t9,2
    bne         zero,AT,mice007016
    nop
    srl         t8,t1,0x1F
    xor         t9,t9,t8
    andi        t9,t9,1
mice007016:
    beq         zero,t9,mice007008
    nop
    ori         t4,zero,0xFE
    addiu       t3,zero,0xFFFF
    b           mice007008
    nop
    .set        at
END(__mice007)

LEAF(_exceptfff)
    addiu       sp,sp,0xFFB0
    sw          ra,0x48(sp)
    sw          s8,0x38(sp)
    sw          s7,0x3C(sp)
    sw          s6,0x40(sp)
    sw          s5,0x44(sp)
    or          s5,a0,zero
    lw          a0,0x60(sp)
    or          s8,a3,zero
    or          s7,a2,zero
    jal         __fptodp
    or          s6,a1,zero
    or          a0,s8,zero
    sw          v0,0x2C(sp)
    jal         __fptodp
    sw          v1,0x28(sp)
    or          a0,s7,zero
    sw          v0,0x34(sp)
    jal         __fptodp
    sw          v1,0x30(sp)
    lw          t1,0x28(sp)
    sw          t1,0x1C(sp)
    lw          t1,0x2C(sp)
    or          a2,v0,zero
    sw          t1,0x18(sp)
    lw          t1,0x30(sp)
    or          a3,v1,zero
    sw          t1,0x14(sp)
    lw          v0,0x64(sp)
    lw          t1,0x34(sp)
    or          a1,s6,zero
    or          a0,s5,zero
    sw          v0,0x20(sp)
    jal         _except2
    sw          t1,0x10(sp)
    or          a1,zero,zero
    or          a0,zero,zero
    or          s6,v1,zero
    jal         _controlfp
    or          s7,v0,zero
    lui         s8,8
    ori         s8,s8,0x1F
    or          a1,s8,zero
    or          a0,s8,zero
    jal         _controlfp
    or          s5,v0,zero
    or          a1,s8,zero
    jal         _controlfp
    or          a0,s5,zero
    or          a1,s6,zero
    jal         __dptofp
    or          a0,s7,zero
    lw          s8,0x38(sp)
    lw          s7,0x3C(sp)
    lw          s6,0x40(sp)
    lw          s5,0x44(sp)
    lw          ra,0x48(sp)
    jr          ra
    addiu       sp,sp,0x50
END(_exceptfff)

LEAF(__mice008)     //40148158
    .set        noat
    srl         t9,t0,5
    andi        t9,t9,0xF80
    srl         t8,t9,5
    or          t0,t0,t8
    la          AT,_fsr
    sw          t0,0(AT)
    and         t9,t9,t0
    or          v0,a0,zero
    jr          ra
    nop
    .set        at
END(__mice008)

LEAF(__mice009)     //40148144
    .set        noat
    sll         t3,t3,1
    srl         t3,t3,9
    sll         v0,t4,0x17
    or          t3,t3,v0
    or          a0,t3,t1
    srl         t9,t0,5
    andi        t9,t9,0xF80
    srl         t8,t9,5
    or          t0,t0,t8
    la          AT,_fsr
    sw          t0,0(AT)
    and         t9,t9,t0
    or          v0,a0,zero
    jr          ra
    nop
    bne         zero,t4,mice009001
    nop
    beq         zero,t3,__mice010
    nop
mice009001:
    andi        t9,t0,0x100
    beq         zero,t9,mice009002
    nop
    addiu       t4,t4,0xC0
    ori         t0,t0,0x3000
    b           __mice009
    nop
mice009002:
    ori         t9,zero,1
    subu        t9,t9,t4
    ori         v0,zero,0x20
    subu        v0,v0,t9
    sllv        t8,t3,v0
    srlv        t3,t3,t9
    sltiu       AT,t9,0x20
    bne         zero,AT,mice009003
    nop
    or          t8,t8,t3
    ori         t3,zero,0
mice009003:
    andi        v0,t3,0xFF
    or          t8,t8,v0
    beq         zero,t8,mice009004
    nop
    ori         t0,t0,0x1000
mice009004:
    lui         AT,0x100
    and         t9,t0,AT
    beq         zero,t9,mice009005
    nop
    ori         t3,zero,0
    ori         t4,zero,0
    lui         AT,0x7F80
    and         t9,a0,AT
    beq         zero,t9,mice009006
    nop
    lui         AT,0x7F80
    and         t9,a1,AT
    bne         zero,t9,mice009007
    nop
mice009006:
    ori         t1,zero,0
    addiu       AT,zero,0xEFFF
    and         t0,t0,AT
    b           __mice010
    nop
mice009007:
    ori         t0,t0,0x3000
    andi        t9,t0,3
    slti        AT,t9,2
    bne         zero,AT,__mice010
    nop
    sll         t9,t9,0x1F
    xor         t9,t9,t1
    bne         zero,t9,__mice010
    nop
    ori         t4,zero,1
    b           __mice010
    nop
mice009005:
    ori         t4,zero,0
    bne         zero,t8,mice009008
    nop
    lui         AT,0x7F80
    and         t9,a0,AT
    beq         zero,t9,__mice010
    nop
    lui         AT,0x7F80
    and         t9,a1,AT
    beq         zero,t9,__mice010
    nop
    andi        t9,t0,0x1000
    beq         zero,t9,__mice010
    nop
mice009008:
    ori         t0,t0,0x3000
    b           __mice010
    nop
    ori         t0,t0,0x5000
    addi        t4,t4,0xFF40
    andi        t9,t0,0x200
    beq         zero,t9,mice009009
    nop
    sltiu       AT,t4,0xFF
    bne         zero,AT,__mice009
    nop
mice009009:
    ori         t4,zero,0xFF
    ori         t3,zero,0
    andi        t9,t0,3
    slti        AT,t9,2
    bne         zero,AT,mice009010
    nop
    srl         t8,t1,0x1F
    xor         t9,t9,t8
    andi        t9,t9,1
mice009010:
    beq         zero,t9,__mice009
    nop
    ori         t4,zero,0xFE
    addiu       t3,zero,0xFFFF
    b           __mice009
    nop
    .set        at
END(__mice009)

LEAF(__mice010)     //40148138
    .set        noat
    sltiu       AT,t4,0xFF
    beq         zero,AT,__mice011
    nop
    sll         t3,t3,1
    srl         t3,t3,9
    sll         v0,t4,0x17
    or          t3,t3,v0
    or          a0,t3,t1
    srl         t9,t0,5
    andi        t9,t9,0xF80
    srl         t8,t9,5
    or          t0,t0,t8
    la          AT,_fsr
    sw          t0,0(AT)
    and         t9,t9,t0
    or          v0,a0,zero
    jr          ra
    nop
    .set        at
END(__mice010)

LEAF(__mice011)     //401482B0
    .set        noat
    ori         t0,t0,0x5000
    addi        t4,t4,0xFF40
    andi        t9,t0,0x200
    beq         zero,t9,mice011001
    nop
    sltiu       AT,t4,0xFF
    bne         zero,AT,__mice009
    nop
mice011001:
    ori         t4,zero,0xFF
    ori         t3,zero,0
    andi        t9,t0,3
    slti        AT,t9,2
    bne         zero,AT,mice011002
    nop
    srl         t8,t1,0x1F
    xor         t9,t9,t8
    andi        t9,t9,1
mice011002:
    beq         zero,t9,__mice009
    nop
    ori         t4,zero,0xFE
    addiu       t3,zero,0xFFFF
    b           __mice009
    nop
    .set        at
END(__mice011)

LEAF(__fpdiv)
    .set        noat
    addiu       sp,sp,0xFFE0
    sw          ra,0x18(sp)
    jal         __mice006
    nop
    xor         t1,a0,a1
    and         t1,t1,v1
    sltiu       AT,t9,0xFE
    beq         zero,AT,fpdiv001
    nop
fpdiv020:
    addiu       t9,t7,0xFFFF
    sltiu       AT,t9,0xFE
    beq         zero,AT,fpdiv002
    nop
fpdiv025:
    sltu        AT,t3,t6
    bne         zero,AT,fpdiv003
    nop
    srl         t3,t3,1
    addiu       t4,t4,1
fpdiv003:
    srl         t5,t6,0xE
    divu        t3,t5
    bne         zero,t5,fpdiv004
    nop
    break 0
fpdiv004:
    mflo        v1
    nop
    nop
    mfhi        t9
    nop
    nop
    andi        t2,t6,0x3FFF
    multu       t2,v1
    mflo        v0
    nop
    nop
    sll         t9,t9,0xE
    sltu        t8,t9,v0
    subu        t9,t9,v0
    beq         zero,t8,fpdiv005
    nop
    addiu       v1,v1,0xFFFF
    addu        t9,t9,t6
    sltu        t8,t9,t6
fpdiv005:
    divu        t9,t5
    bne         zero,t5,fpdiv006
    nop
    break 0
fpdiv006:
    mflo        t3
    nop
    nop
    mfhi        t9
    nop
    nop
    multu       t2,t3
    mflo        v0
    nop
    nop
    sll         t9,t9,0xE
    sltu        t8,t9,v0
    subu        t9,t9,v0
    beq         zero,t8,fpdiv007
    nop
    addiu       t3,t3,0xFFFF
    addu        t9,t9,t6
    sltu        t8,t9,t6
fpdiv007:
    sll         t8,v1,0xE
    addu        t3,t3,t8
    sll         t3,t3,4
    beq         zero,t9,fpdiv008
    nop
    ori         t3,t3,1
fpdiv008:
    ori         t9,zero,0x7E
    subu        t9,t9,t7
    addu        t4,t4,t9
    jal         __mice007
    nop
fpdiv018:
    bne         zero,t9,fpdiv009
    nop
fpdiv010:
    lw          ra,0x18(sp)
    addiu       sp,sp,0x20
    jr          ra
    nop
fpdiv009:
    lw          a2,8(sp)
    lw          a3,0xC(sp)
    sw          a0,0x10(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,4
    jal         _exceptfff
    nop
    b           fpdiv010
    nop
fpdiv001:
    addu        t3,t3,t3
    beq         zero,t4,fpdiv011
    nop
    bne         zero,t3,fpdiv012
    nop
    ori         AT,zero,0xFF
    bne         AT,t7,fpdiv013
    nop
    addu        t9,t6,t6
    bne         zero,t9,fpdiv002
    nop
    b           fpdiv014
    nop
fpdiv012:
    lui         AT,0x3F
    ori         AT,AT,0xFFFF
    and         a0,a0,AT
    bgtz        t3,fpdiv015
    nop
    beq         zero,a0,fpdiv014
    nop
    ori         AT,zero,0xFF
    bne         AT,t7,fpdiv014
    nop
    addu        t9,t6,t6
    bgtz        t9,fpdiv016
    nop
fpdiv014:
    lui         a0,0x7FBF
    ori         a0,a0,0xFFFF
    b           fpdiv016
    nop
fpdiv015:
    ori         AT,zero,0xFF
    bne         AT,t7,fpdiv017
    nop
    addu        t9,t6,t6
    bgez        t9,fpdiv017
    nop
fpdiv016:
    lui         AT,1
    or          t0,t0,AT
fpdiv017:
    lui         AT,0x7F80
    or          a0,a0,AT
fpdiv024:
    jal         __mice008
    nop
    b           fpdiv018
    nop
fpdiv013:
    jal         __mice009
    nop
    b           fpdiv018
    nop
fpdiv011:
    beq         zero,t3,fpdiv019
    nop
fpdiv021:
    blez        t3,fpdiv020
    nop
    addu        t3,t3,t3
    addiu       t4,t4,0xFFFF
    b           fpdiv021
    nop
fpdiv019:
    addu        t9,a1,a1
    beq         zero,t9,fpdiv014
    nop
    ori         AT,zero,0xFF
    bne         AT,t7,fpdiv013
    nop
fpdiv002:
    addu        t6,t6,t6
    bne         zero,t7,fpdiv022
    nop
    bne         zero,t6,fpdiv023
    nop
    ori         t0,t0,0x8000
    lui         AT,0x7F80
    or          a0,t1,AT
    b           fpdiv024
    nop
fpdiv023:
    blez        t6,fpdiv025
    nop
    addu        t6,t6,t6
    addiu       t7,t7,0xFFFF
    b           fpdiv023
    nop
fpdiv022:
    bne         zero,t6,fpdiv026
    nop
    or          a0,t1,zero
    b           fpdiv024
    nop
fpdiv026:
    bltz        t6,fpdiv014
    nop
    lui         AT,0x7FFF
    ori         AT,AT,0xFFFF
    and         a0,a1,AT
    bne         zero,t6,fpdiv024
    nop
    lui         AT,0x7F80
    or          a0,t1,AT
    b           fpdiv024
    nop
    .set        at
END(__fpdiv)

LEAF(__fpsub)
    .set        noat
    lui         AT,0x8000
    xor         a1,a1,AT
    j           __fpadd
    nop
    .set        at
END(__fpsub)

LEAF(__fpadd)
    .set        noat
    addiu       sp,sp,0xFFE0
    sw          ra,0x18(sp)
    jal         __mice006
    nop
    and         t1,a0,v1
    sltiu       AT,t9,0xFE
    beq         zero,AT,fpadd001
    nop
fpadd024:
    addiu       t9,t7,0xFFFF
    sltiu       AT,t9,0xFE
    beq         zero,AT,fpadd002
    nop
fpadd027:
    subu        t8,t4,t7
    bltz        t8,fpadd003
    nop
    slti        AT,t8,0x20
    bne         zero,AT,fpadd004
    nop
    lui         AT,0x7FFF
    ori         AT,AT,0xFFFF
    and         t9,a1,AT
    beq         zero,t9,fpadd005
    nop
    ori         t6,zero,2
    b           fpadd005
    nop
fpadd004:
    or          v0,t6,zero
    srlv        t6,t6,t8
    sllv        t9,t6,t8
    beq         v0,t9,fpadd005
    nop
    ori         t6,t6,2
    b           fpadd005
    nop
fpadd003:
    or          t4,t7,zero
    subu        t8,zero,t8
    slti        AT,t8,0x20
    bne         zero,AT,fpadd006
    nop
    lui         AT,0x7FFF
    ori         AT,AT,0xFFFF
    and         t9,a0,AT
    beq         zero,t9,fpadd005
    nop
    ori         t3,zero,2
    b           fpadd005
    nop
fpadd006:
    or          v0,t3,zero
    srlv        t3,t3,t8
    sllv        t9,t3,t8
    beq         v0,t9,fpadd005
    nop
    ori         t3,t3,2
fpadd005:
    xor         t9,t1,a1
    bltz        t9,fpadd007
    nop
    addu        t3,t3,t6
    sltu        t9,t3,t6
    beq         zero,t9,fpadd008
    nop
    andi        t9,t3,1
    beq         zero,t9,fpadd009
    nop
    ori         t3,t3,2
fpadd009:
    srl         t3,t3,1
    addiu       t4,t4,1
    or          t3,t3,v1
    b           fpadd008
    nop
fpadd007:
    sltu        t9,t3,t6
    subu        t3,t3,t6
    beq         zero,t3,fpadd010
    nop
    beq         zero,t9,fpadd011
    nop
    subu        t3,zero,t3
    xor         t1,t1,v1
fpadd011:
    blez        t3,fpadd008
    nop
    addu        t3,t3,t3
    addiu       t4,t4,0xFFFF
    b           fpadd011
    nop
fpadd008:
    jal         __mice007
    nop
fpadd020:
    bne         zero,t9,fpadd012
    nop
fpadd013:
    lw          ra,0x18(sp)
    addiu       sp,sp,0x20
    jr          ra
    nop
fpadd012:
    lw          a2,8(sp)
    lw          a3,0xC(sp)
    sw          a0,0x10(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,1
    jal         _exceptfff
    nop
    b           fpadd013
    nop
fpadd001:
    addu        t3,t3,t3
    beq         zero,t4,fpadd014
    nop
    beq         zero,t3,fpadd015
    nop
    lui         AT,0x3F
    ori         AT,AT,0xFFFF
    and         a0,a0,AT
    bgtz        t3,fpadd016
    nop
    beq         zero,a0,fpadd017
    nop
    ori         AT,zero,0xFF
    bne         AT,t7,fpadd017
    nop
    addu        t9,t6,t6
    bgtz        t9,fpadd018
    nop
fpadd017:
    lui         a0,0x7FBF
    ori         a0,a0,0xFFFF
    b           fpadd018
    nop
fpadd016:
    ori         AT,zero,0xFF
    bne         AT,t7,fpadd019
    nop
    addu        t9,t6,t6
    bgez        t9,fpadd019
    nop
fpadd018:
    lui         AT,1
    or          t0,t0,AT
fpadd019:
    lui         AT,0x7F80
    or          a0,a0,AT
fpadd022:
    jal         __mice008
    nop
    b           fpadd020
    nop
fpadd015:
    ori         AT,zero,0xFF
    bne         AT,t7,fpadd021
    nop
    addu        t9,t6,t6
    bne         zero,t9,fpadd002
    nop
    bne         a1,a0,fpadd017
    nop
    b           fpadd022
    nop
fpadd014:
    beq         zero,t3,fpadd023
    nop
fpadd025:
    blez        t3,fpadd024
    nop
    addu        t3,t3,t3
    addiu       t4,t4,0xFFFF
    b           fpadd025
    nop
fpadd023:
    ori         AT,zero,0xFF
    bne         AT,t7,fpadd024
    nop
fpadd002:
    addu        t6,t6,t6
    bne         zero,t7,fpadd026
    nop
    beq         zero,t6,fpadd027
    nop
fpadd028:
    blez        t6,fpadd027
    nop
    addu        t6,t6,t6
    addiu       t7,t7,0xFFFF
    b           fpadd028
    nop
fpadd026:
    beq         zero,t6,fpadd029
    nop
    bltz        t6,fpadd017
    nop
    lui         AT,0x7FFF
    ori         AT,AT,0xFFFF
    and         a1,a1,AT
fpadd029:
    or          a0,a1,zero
    b           fpadd022
    nop
fpadd010:
    sll         t8,t0,0x1E
    bltz        t8,fpadd030
    nop
    bgtz        t7,fpadd031
    nop
    sll         t9,a1,1
    bne         zero,t9,fpadd032
    nop
fpadd031:
    ori         t1,zero,0
    b           fpadd032
    nop
fpadd030:
    bltz        t7,fpadd032
    nop
    bne         zero,t7,fpadd033
    nop
    bne         zero,t6,fpadd032
    nop
fpadd033:
    sll         t1,t8,1
fpadd032:
    or          a0,t1,zero
    slti        AT,t7,0x1A
    beq         zero,AT,fpadd022
    nop
    blez        t7,fpadd022
    nop
    lui         AT,0x100
    and         t9,t0,AT
    beq         zero,t9,fpadd022
    nop
    ori         t0,t0,0x3000
    bgez        t8,fpadd022
    nop
    ori         t4,zero,1
fpadd021:
    jal         __mice009
    nop
    b           fpadd020
    nop
    .set        at
END(__fpadd)

LEAF(__gts)
    .set        noat
    addiu       sp,sp,0xFFE0
    sw          ra,0x18(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x1C(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,0x20(sp)
    sw          a1,0x24(sp)
    sll         a2,a0,1
    sll         a3,a1,1
    or          t0,a2,a3
    beq         zero,t0,gts001
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a2,AT
    beq         zero,AT,gts002
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a3,AT
    beq         zero,AT,gts002
    nop
    srl         a2,a2,1
    bgez        a0,gts003
    nop
    subu        a2,zero,a2
gts003:
    srl         a3,a3,1
    bgez        a1,gts004
    nop
    subu        a3,zero,a3
gts004:
    slt         AT,a2,a3
    beq         zero,AT,gts005
    nop
    ori         v0,zero,0
    b           gts006
    nop
gts005:
    slt         AT,a3,a2
    beq         zero,AT,gts001
    nop
    ori         v0,zero,1
    b           gts006
    nop
gts001:
    ori         v0,zero,0
gts006:
    addiu       sp,sp,0x20
    jr          ra
    nop
gts002:
    ori         a0,zero,0
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    lw          a2,0x20(sp)
    lw          a3,0x24(sp)
    lw          t2,0x1C(sp)
    sw          a0,0x10(sp)
    sw          t2,0x14(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,7
    jal         _exceptlff
    nop
    lw          ra,0x18(sp)
    b           gts006
    nop
    .set        at
END(__gts)

LEAF(_exceptlff)
    addiu       sp,sp,0xFFB0
    sw          ra,0x48(sp)
    sw          s8,0x38(sp)
    sw          s7,0x3C(sp)
    sw          s6,0x40(sp)
    sw          s5,0x44(sp)
    or          s5,a0,zero
    lw          a0,0x60(sp)
    or          s8,a3,zero
    or          s7,a2,zero
    jal         __litodp
    or          s6,a1,zero
    or          a0,s8,zero
    sw          v0,0x2C(sp)
    jal         __fptodp
    sw          v1,0x28(sp)
    or          a0,s7,zero
    sw          v0,0x34(sp)
    jal         __fptodp
    sw          v1,0x30(sp)
    lw          t1,0x28(sp)
    sw          t1,0x1C(sp)
    lw          t1,0x2C(sp)
    or          a2,v0,zero
    sw          t1,0x18(sp)
    lw          t1,0x30(sp)
    or          a3,v1,zero
    sw          t1,0x14(sp)
    lw          v0,0x64(sp)
    lw          t1,0x34(sp)
    or          a1,s6,zero
    or          a0,s5,zero
    sw          v0,0x20(sp)
    jal         _except2
    sw          t1,0x10(sp)
    or          a1,zero,zero
    or          a0,zero,zero
    or          s6,v1,zero
    jal         _controlfp
    or          s7,v0,zero
    lui         s8,8
    ori         s8,s8,0x1F
    or          a1,s8,zero
    or          a0,s8,zero
    jal         _controlfp
    or          s5,v0,zero
    or          a1,s8,zero
    jal         _controlfp
    or          a0,s5,zero
    or          a1,s6,zero
    jal         __dptoli
    or          a0,s7,zero
    lw          s8,0x38(sp)
    lw          s7,0x3C(sp)
    lw          s6,0x40(sp)
    lw          s5,0x44(sp)
    lw          ra,0x48(sp)
    jr          ra
    addiu       sp,sp,0x50
END(_exceptlff)

LEAF(__ges)
    .set        noat
    addiu       sp,sp,0xFFE0
    sw          ra,0x18(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x1C(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,0x20(sp)
    sw          a1,0x24(sp)
    sll         a2,a0,1
    sll         a3,a1,1
    or          t0,a2,a3
    beq         zero,t0,ges001
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a2,AT
    beq         zero,AT,ges002
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a3,AT
    beq         zero,AT,ges002
    nop
    srl         a2,a2,1
    bgez        a0,ges003
    nop
    subu        a2,zero,a2
ges003:
    srl         a3,a3,1
    bgez        a1,ges004
    nop
    subu        a3,zero,a3
ges004:
    slt         AT,a2,a3
    beq         zero,AT,ges005
    nop
    ori         v0,zero,0
    b           ges006
    nop
ges005:
    slt         AT,a3,a2
    beq         zero,AT,ges001
    nop
    ori         v0,zero,1
    b           ges006
    nop
ges001:
    ori         v0,zero,1
ges006:
    addiu       sp,sp,0x20
    jr          ra
    nop
ges002:
    ori         a0,zero,0
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    lw          a2,0x20(sp)
    lw          a3,0x24(sp)
    lw          t2,0x1C(sp)
    sw          a0,0x10(sp)
    sw          t2,0x14(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,7
    jal         _exceptlff
    nop
    lw          ra,0x18(sp)
    b           ges006
    nop
    .set        at
END(__ges)

LEAF(__lts)
    .set        noat
    addiu       sp,sp,0xFFE0
    sw          ra,0x18(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x1C(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,0x20(sp)
    sw          a1,0x24(sp)
    sll         a2,a0,1
    sll         a3,a1,1
    or          t0,a2,a3
    beq         zero,t0,lts001
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a2,AT
    beq         zero,AT,lts002
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a3,AT
    beq         zero,AT,lts002
    nop
    srl         a2,a2,1
    bgez        a0,lts003
    nop
    subu        a2,zero,a2
lts003:
    srl         a3,a3,1
    bgez        a1,lts004
    nop
    subu        a3,zero,a3
lts004:
    slt         AT,a2,a3
    beq         zero,AT,lts005
    nop
    ori         v0,zero,1
    b           lts006
    nop
lts005:
    slt         AT,a3,a2
    beq         zero,AT,lts001
    nop
    ori         v0,zero,0
    b           lts006
    nop
lts001:
    ori         v0,zero,0
lts006:
    addiu       sp,sp,0x20
    jr          ra
    nop
lts002:
    ori         a0,zero,0
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    lw          a2,0x20(sp)
    lw          a3,0x24(sp)
    lw          t2,0x1C(sp)
    sw          a0,0x10(sp)
    sw          t2,0x14(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,7
    jal         _exceptlff
    nop
    lw          ra,0x18(sp)
    b           lts006
    nop
    .set        at
END(__lts)

LEAF(__les)
    .set        noat
    addiu       sp,sp,0xFFE0
    sw          ra,0x18(sp)
    la          AT,_fsr
    lw          t9,0(AT)
    xori        t8,t9,0xF80
    sw          t8,0x1C(sp)
    lui         t8,0xFFFE
    ori         t8,t8,0xFFF
    and         t9,t9,t8
    la          AT,_fsr
    sw          t9,0(AT)
    sw          a0,0x20(sp)
    sw          a1,0x24(sp)
    sll         a2,a0,1
    sll         a3,a1,1
    or          t0,a2,a3
    beq         zero,t0,les001
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a2,AT
    beq         zero,AT,les002
    nop
    lui         AT,0xFF00
    ori         AT,AT,1
    sltu        AT,a3,AT
    beq         zero,AT,les002
    nop
    srl         a2,a2,1
    bgez        a0,les003
    nop
    subu        a2,zero,a2
les003:
    srl         a3,a3,1
    bgez        a1,les004
    nop
    subu        a3,zero,a3
les004:
    slt         AT,a2,a3
    beq         zero,AT,les005
    nop
    ori         v0,zero,1
    b           les006
    nop
les005:
    slt         AT,a3,a2
    beq         zero,AT,les001
    nop
    ori         v0,zero,0
    b           les006
    nop
les001:
    ori         v0,zero,1
les006:
    addiu       sp,sp,0x20
    jr          ra
    nop
les002:
    ori         a0,zero,0
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
    lw          a2,0x20(sp)
    lw          a3,0x24(sp)
    lw          t2,0x1C(sp)
    sw          a0,0x10(sp)
    sw          t2,0x14(sp)
    jal         _getNOCp
    nop
    ori         a1,zero,7
    jal         _exceptlff
    nop
    lw          ra,0x18(sp)
    b           les006
    nop
    .set        at
END(__les)

LEAF(_exceptud)
    addiu       sp,sp,0xFFC8
    sw          ra,0x30(sp)
    sw          s8,0x20(sp)
    sw          s7,0x24(sp)
    sw          s6,0x28(sp)
    sw          s5,0x2C(sp)
    or          s5,a0,zero
    lw          a0,0x48(sp)
    or          s8,a3,zero
    or          s7,a2,zero
    jal         __ultodp
    or          s6,a1,zero
    lw          a3,0x4C(sp)
    or          a2,s7,zero
    sw          a3,0x18(sp)
    or          a3,s8,zero
    or          a1,s6,zero
    or          a0,s5,zero
    sw          v1,0x14(sp)
    jal         _except1
    sw          v0,0x10(sp)
    or          a1,zero,zero
    or          a0,zero,zero
    or          s6,v1,zero
    jal         _controlfp
    or          s7,v0,zero
    lui         s8,8
    ori         s8,s8,0x1F
    or          a1,s8,zero
    or          a0,s8,zero
    jal         _controlfp
    or          s5,v0,zero
    or          a1,s8,zero
    jal         _controlfp
    or          a0,s5,zero
    or          a1,s6,zero
    jal         __dptoul
    or          a0,s7,zero
    lw          s8,0x20(sp)
    lw          s7,0x24(sp)
    lw          s6,0x28(sp)
    lw          s5,0x2C(sp)
    lw          ra,0x30(sp)
    jr          ra
    addiu       sp,sp,0x38
END(_exceptud)

LEAF(__d_to_ull)
    .set        noat
    la          AT,_fsr
    lw          t6,0(AT)
    lui         t7,0xFFFE
    ori         t7,t7,0xFFF
    and         t6,t6,t7
    la          AT,_fsr
    sw          t6,0(AT)
    ori         t7,zero,0
    sll         t1,a1,1
    srl         t1,t1,0x15
    sll         a3,a1,0xB
    srl         t5,a0,0x15
    or          a3,a3,t5
    sll         t0,a0,0xB
    lui         AT,0x8000
    or          a3,a3,AT
    or          t2,zero,a3
    or          t3,zero,t0
    sltiu       AT,t1,0x43F
    beq         zero,AT,__d_to_ull_1
    nop
    ori         a2,zero,0x43E
    subu        a2,a2,t1
    sltiu       AT,a2,0x40
    bne         zero,AT,__d_to_ull_2
    nop
    bne         zero,t1,__d_to_ull_3
    nop
    lui         AT,0x7FFF
    ori         AT,AT,0xFFFF
    and         t2,t2,AT
    la          AT,_fsr
    lw          t6,0(AT)
    lui         AT,0x100
    and         t6,t6,AT
    bne         zero,t6,__d_to_ull_4
    nop
__d_to_ull_3:
    srl         t6,t3,0xB
    or          t7,t2,t6
    beq         zero,t7,__d_to_ull_4
    nop
    lui         AT,0x8000
    sltu        AT,a1,AT
    beq         zero,AT,__d_to_ull_1
    nop
__d_to_ull_4:
    ori         t2,zero,0
    ori         t3,zero,0
    b           __d_to_ull_5
    nop
__d_to_ull_2:
    lui         AT,0x8000
    sltu        AT,a1,AT
    beq         zero,AT,__d_to_ull_1
    nop
    addiu       t5,a2,0xFFE0
    bltz        t5,__d_to_ull_6
    nop
    sltu        t7,zero,t3
    beq         zero,t5,__d_to_ull_7
    nop
    ori         t6,zero,0x20
    sub         t6,t6,t5
    sllv        t6,t2,t6
    or          t7,t6,t7
__d_to_ull_7:
    srlv        t3,t2,t5
    ori         t2,zero,0
    b           __d_to_ull_5
    nop
__d_to_ull_6:
    subu        t5,zero,t5
    ori         AT,zero,0x20
    beq         AT,t5,__d_to_ull_5
    nop
    sllv        t7,t3,t5
    srlv        t7,t7,t5
    srlv        t3,t3,a2
    sllv        t5,t2,t5
    or          t3,t3,t5
    srlv        t2,t2,a2
__d_to_ull_5:
    beq         zero,t7,__d_to_ull_8
    nop
    la          AT,_fsr
    lw          t6,0(AT)
    ori         t6,t6,0x1004
    la          AT,_fsr
    sw          t6,0(AT)
__d_to_ull_8:
    or          v1,zero,t2
    or          v0,zero,t3
__d_to_ull_11:
    jr          ra
    nop
__d_to_ull_1:
    ori         AT,zero,0x7FF
    bne         AT,t1,__d_to_ull_9
    nop
    sll         a3,a3,1
    srl         t0,t0,0xB
    or          t9,a3,t0
    lui         AT,0x8000
    sltu        AT,t9,AT
    beq         zero,AT,__d_to_ull_9
    nop
    bne         zero,t9,__d_to_ull_10
    nop
__d_to_ull_9:
    la          AT,_fsr
    lw          t9,0(AT)
    lui         AT,1
    ori         AT,AT,0x40
    or          t9,t9,AT
    la          AT,_fsr
    sw          t9,0(AT)
__d_to_ull_10:
    addiu       v0,zero,0xFFFF
    addiu       v1,zero,0xFFFF
    b           __d_to_ull_11
    nop
    .set        at
END(__d_to_ull)

#endif
